Linux User, user group Rights Management detailed---02

Source: Internet
Author: User

2, user, user group management operation detailed:

2.1 AddUser Add Users:


AddUser [-u uid][-g group][-d home][-s Shell]

- u: give directly the UserID

- G: give directly the GID

- D: directly establish the root directory in an existing directory         

- S: definition Shell


Add User Garfield

1 adduser garfield


Verify that the user Garfield was successfully added through the three user management files described earlier:

When we create new users, the basic settings for new users are implemented through the/etc/login.defs and/etc/default/useradd two files.

Cat/etc/login.defs

Cat/etc/default/useradd

in this file Skel This option specifies that the user's root directory content is copied from the/etc/skel directory in the past.

2.2 passwd Set User password:

passwd [user name] setting password


2.3 usermod Disable, Enable account:

usermod-l [user name ] Disable account

usermod-u [user name ] Enable account

usermod-e yyyy-mm-dd [user name ]


Usermod command to disable and enable accounts through the /etc/shadow the corresponding user password bit before adding and deleting "!" to implement.


2.4 Groupadd Create Group:

Groupadd [-G gid [-o]] [-R] [-F] Group


2.4.1 when creating a user, specify that the user belongs to that user group :

Usersadd-g group_name user_name


2.4.2 to change a user's user group:

Usermod–g group_name user_name


2.4.3 adding users to other groups:

Usermod–g group_name user_name

2.5 Modify the name of the group:

Groupmod-n new_group_name old_ group_name





2.6 Modify User name:

Usermod–l New_user_name old_ user_name


2.7 Deleting a User:

Userdel [-R] User_name


2.8 To Delete a group:

Groupdel group_name

Linux User, user group Rights Management detailed---02

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.