User and Group Management

Source: Internet
Author: User

One, user profile and password configuration file
/bin/bash can log in
/sbin/nologin even if you set a password or can't log in
Etc/shawow and ETC/PASSWD are similar
Second, user group management
Groupadd Add Group
You can also specify the ID of the group
Groupadd-g 1005 Grp2 (centos7 above increase group needs more than 1000, 1000 within the system reservation, CENTOS6 500 or more) to specify GID
Groupdel Deleting a group
Groupdel GRP2
Tail-n1/etc/group View (number indicates a few lines)
The premise of removing 1 groups is that there are no users in the user who will be prompted not to delete
etc/shadow-//etc/passwd/etc/gshadow-/file behind the belt-, the system automatically for our backup, accidentally deleted, can be copied back, there may be new users are not updated in a timely manner.
Third, user management
Useradd adding users
Useradd-u 1006-g grp1-d/home/yylinux111-s/sbin/nologin user4 Specify user uid GID and home directory
Useradd-m User5 Create a user without creating a user's home directory
Userdel Deleting a user
The AddUser useradd effect is consistent.
Iv. usermod Command
Change Properties Command Usermod
Usermod-u 111 username
Usermod-g GID username
user-d/HOME/SADASDASD username
Usermod-s/sbin.nologin username
Usermod-g Grp2 (-G = Expansion Group)
Expansion group Delete usermod-g groupname username (remove the user from another user group and add to the specified user group)

User and Group Management

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.