Linux user groups and user management

Source: Internet
Author: User

    • View information for all groups: (Information is saved in the/etc/group file)
    • Each of these pieces of information is divided by: the meaning of each paragraph is as follows:

       User name Group name: password: User group ID: User group contains users (multiple users, split)

    • View all user information: (Information saved in the/etc/passwd file)

Each of these pieces of information is divided by: the meaning of each paragraph is as follows:

  User name: password: User id: ID of the user group: note Information: User directory: directory where the command is located

    • View a user's information
      • Command: CAT/ETC/PASSWD | grep User Name

    • View a user group information
      • Command: Cat/etc/group |grep Group name

    • View group member information for the currently logged in user
      • Command: Groups

    • View user groups and members within a group
      • Command: Groups user
    • View the currently logged in user name
      • Command: WhoAmI
      •  

    • Add Users
      • Command: Useradd user name
      • Example: Useradd Sky
    • Add users to the home directory at the same time
      • Command: USERADD-M user name
      • Example: Useradd-m Sky
    • Delete User
      • Command: Userdel user name
      • Example: Userdel Sky
    • Delete user and delete user name directory under home directory
      • Command: Userdel-r user name
      • For example: Userdel-r Sky #系统将自动删除/home/sky This user directory, regardless of whether the directory is empty
    • Setting and modifying user passwords
      • Command: passwd user name
      • Example: passwd Sky #这样系统要求输入两次密码

Linux user groups and user management

Related Article

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.