Linux User Group Management

Source: Internet
Author: User

User group information:/etc/group when there is only one user in the group, and the user name and user group name are the same, the default is not displayed; Group number 1-499 is a system reserved user group, the >=500 user group is created manually by the administrator, and the group password placeholder is represented by x Group Password profile:/etc/gshadow is also a four-stage storage, one! The password for the group is empty, such as SSH-free login! User information:/etc/passwd root User ID is 0, normal user starting from 500, less than 500 is the software installation allocation directory, and the default shell is Nologin, the normal user shell is:/bin/bash User password file:/etc/shadow  User group creation: Groupadd group1User group name modification: groupmod-n newgroup group1User Group number modification: Groupmod-g 668 newgroup Create user group at the same time, specify number: Groupadd-g 888 boss Delete user group: Groupdel newgroup You must remove users before you can delete them add a new user to a user group: USERADD-G boss SDF continues to add: Useradd-g boss JZMB Add new user and specify user home directory: useradd-d/home/test1 test does not specify that the system will create a folder with the same user name Modify User's notes: usermod-c Beizhu SDFModify User name: Usermod-l cls SDFModify a new personal directory: usermod-d/home/cls CLS Modify a user's owning group: USERMOD-G target group name user nameDelete User: Userdel JZMB then you need to delete your home directory: RM-RF/HOME/JZMBcomplete removal of users, including home directory: Userdel-r JZMB prohibit all users except the root user from logging in: Touch/etc/nologinLifting limit: Rm/etc/nologin Lock specified User login: Passwd-l user1unlock specified account: Passwd-u user1Clear account password: passwd-d user1  a user can belong to multiple groups, one primary group, multiple satellite groupsgpasswd-a User1 group adds groups to User1, and the primary group is unaffectedgpasswd-a user1 group,group2 Add multipleuser1 switch from the primary group to the specified satellite group after the user logs on NEWGRP group if the subordinate group has a password to enterremove a satellite group: gpasswd-d User1 group removes User1 from the Group satellite group specify primary and secondary groups when creating users:useradd-g group-g group1,group2 user2 Where-g specifies the primary group,-G specifies the satellite group Set user group password: GPASSWD Group Enter the password when prompted user identity switch: SU usernameswitch to root user: Su and Su-or SU rootThe normal user switches to the root user or other user needs to enter the password, and the root user switches to the normal user does not enter the passwordWhoAmI View the currently logged in user name, who I amID Username View information such as the group to which the user ID belongsgroups username Show all groups to which the user belongsCHFN Username Set the user's profile, enterfinger username Show user Details Password modification: Use passwd command to change password after normal user loginroot user to modify the normal user password use: passwd username directly enter the new password canroot user to modify their own password using: passwd or passwd root to enter the new password directly

Linux User 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.