Share files in Linux and your team

Source: Internet
Author: User

In a project group, a member of a group wants to share a file for co-development, and we build lucy,lewis,mike,peter four users so that they are all in the group workgroup:

# #新建一个名为workgroup的用户组

Groupadd Workgroup

# #新建上面四个用户, and put it directly into the workgroup group

Useradd-g Workgroup Lucy # #将用户lucy放入组workgroup中, if you don't have this user, create it

passwd Lucy # #为lucy用户设置密码

Useradd-g Workgroup Lewis # #将用户lewis放入组workgroup中, if you don't have this user, create it

passwd Lewis # #为用户lewis设置密码

Two other users we do the same.


Below we will create a new work folder under the/home folder as the working directory for this group

Cd/home # #切换到home文件夹

mkdir Work # #新建work文件夹

Anyone can access this new directory at this point, but only the root user has write access to the directory, so we have to let users in the workgroup have write access to it, while others cannot view the directory.

CHGRP Workgroup work/# #把work目录的所有权交给workgroup组

chmod g+rwx work/# #增加workgroup组对于work文件夹的读, write, execute permissions

chmod o-rwx work/# #撤销其它用户对于work文件夹的读, write, execute permissions

Next, we'll give the work catalogue to a team leader, Lewis.

Chown Lewis work/# #将work目录的所有者更改为lewis用户

At this point, all members of the workgroup can do nothing with the contents of the work directory, and other users do not have any permissions


This article is from "Aixinjueluo Radium Blog" blog, please be sure to keep this source http://hackcrack.blog.51cto.com/6169318/1575483

Share files in Linux and your team

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.