Linux Learning Notes (4)

Source: Internet
Author: User

User Group Management:

1. groupadd User group name

eg, gruopadd grp1 #创建用户组grp1

2. Gruopdel user group name

eg, groupdel grp1 #删除用户组grp1

User management:

1. useradd [option] User name

eg, useradd usr1 #创建用户usr1;

Useradd-u 322-g grp1-g grp2 usr1 #建立用户usr1, the UID is 322, the main user group is GRP1, and the additional user group is GRP2;

2, passwd user name #建立用户的登录密码;

3, userdel user name #删除用户;

4. usermod [option] User name #修改用户属性

eg, usermod-g grp2 usr1 #将用户usr1的主用户组更改为grp2; '

5, chown [user]:[User Group] file list #改变文件的所属用户和组

eg, chown usr1 myfile #设置文件myfile所属用户为usr1

Chown:gep1 myfile #设置文件myfile所属用户组为grp1

Chown usr1:grp1 myfile #设置文件myfile所属用户和用户组分别为usr1和grp1

6, chmod

eg, chmod a=--x demon #所有用户对demon都有执行权限

chmod u+r--Demon #属主用户 (own user) has read access to Demon

chmod G=-w-demon #属主用户组 (all other users in the group) have write access to demon

chmod o=rwx Demon #所有其他用户对demon有读写执行权限

chmod 666 Demon #属主用户 (Own) Read and write to demon, other users in the group have read and write to demon, other users have read and write access to demon

"+" add permission;

"-" Delete permission;

"=" Assignment permission;

Linux Learning Notes (4)

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.