Linux commands-user group management

Source: Internet
Author: User

    • New User group: Groupadd
      • Groupadd [-G GID] Group name

No-G is created according to the system default GID group, like the user, GID is also starting from 500

    • Delete user group: Groupdel
      • Groupdel Group Name

Before deleting a user group, you need to delete the user in the group

    • Added users: useradd
      • Useradd [-U UID] [-G GID] [-D HOME] [-m] [-s] User name
        • -U: Custom UID
        • - G: Make it belong to a GID or gname that already exists(by default, the new user belongs to the same group name as the user name)
        • -D: Customizing the user's home directory
        • -M: Do not set up home directory
        • -S: Custom shell

    • Modify user information: Usermod
      • Usermod [-D Home] [-G GID] [-c Comment] User name
        • -G: Owning group
        • -C: Comments
        • -D: Home directory

    • Delete User: Userdel
      • Userdel [-R] Username
        • - R : The function of the option is to delete the user, along with the user's home directory.

    • Create modify user password: passwd
      • passwd [username] ( non-superuser, cannot specify user name when using this command, not Superuser can only set or modify their own password )
        • passwd does not follow the user name is to change the current user's password

    • User identity switch: su
      • Su [-] username
        • Can be followed by "-" can also not, ordinary users su username is to switch to the root user, of course, the root user can also su to ordinary users

  • Introduction to related configuration files
    • /etc/group : Stores all user group information in the current system
      • GROUP:X: 123:AB,CD, EF
      • Group name: group Password placeholder: Group number: List of user names in the group
    • /etc/passwd : Stores all user information in the current system
      • USER:X: 123:456:xxxxxxxxx:/home/user:/bin/bash
      • User name: Password placeholder: User number: User group number: User comment information: Home directory: Shell type
    • /etc/shadow : Stores password information for all users in the current system
      • USER:VF ..... ::::::
      • User name: Password:::::

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