Linux users and user groups

Source: Internet
Author: User

 

1. view all users in Linux

 

In linux, there are no convenient commands like windows's net user and net localgroup to manage the user. Xwindows interface.

 

(1) In the terminal, you only need to view the/etc/passwd file.

 

(2) Check the third parameter: more than 500, which is the user created later. Others are system users.

 

Or use cat/etc/passwd | cut-f 1-d:

 

 

2. User management commands

 

Useradd Note: Add a user

 

Adduser Note: Add a user

 

Passwd Note: set a password for the user

 

Usermod Note: to modify user commands, you can use usermod to modify the logon name and user's home directory;

 

Pwcov Note: Synchronize users from/etc/passwd to/etc/shadow

 

Pwck Note: pwck verifies whether the content of the user configuration file/etc/passwd and/etc/shadow is legal or complete;

 

Pwunconv Note: it is the vertical reverse operation of pwcov. It is to create/etc/passwd from/etc/shadow and/etc/passwd, and then delete the/etc/shadow file;

 

Finger Note: Tools for viewing user information

 

Id Note: view the UID, GID, and user group of the user.

 

Chfn Note: Change User information tool

 

Su Note: User Switching Tool

 

Sudo Note: sudo uses another user to execute commands (execute a command as another user), su is used to switch users, and then the user to complete the corresponding tasks through the switch, however, sudo can directly execute the following commands. For example, sudo can execute root authorization without the root password. Only root can execute the corresponding commands; however, you must edit/etc/sudoers through mongodo;

 

Except do note: visodo is the command for editing/etc/sudoers. You can also use vi to edit/etc/sudoers;

 

Sudoedit Note: similar to the sudo function;

 

 

3. Tools or commands used to manage user groups;

 

Groupadd Note: Add a user group;

 

Groupdel Note: delete a user group;

 

Groupmod Note: Modify user group information

 

Groups Note: displays the user group to which the user belongs.

 

Grpck

 

Note: Use the/etc/group and/etc/gshadow file content to synchronize or create/etc/gshadow. If/etc/gshadow does not exist, create it;

 

Grpunconv Note: Use the/etc/group and/etc/gshadow file content to synchronize or create/etc/group, and then delete the gshadow File

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.