Add/delete Linux users and groups and delete user groups in linux
1. User Creation:
Adduser phpq // create a phpq user
Passwd phpq // set a password for the phpq user
2. Create a working group
Groupadd test // create a test workgroup
3. Create a user and add a Working Group
Useradd-g test phpq // create a phpq user and add it to the test workgroup
Note: SHELL used by-g's group-d home directory-s
4. Add a working group for existing users
Usermod-G groupname username
Or: gpasswd-a user group
5. temporarily close: Add * before the second field (password) of the row that belongs to the user in the/etc/shadow file. To restore the user, remove.
You can also use the following command to disable the user account:
Passwd peter-l
Release again:
Passwd peter-u
6. Permanently delete user accounts
Userdel peter
Groupdel peter
Usermod-G peter (Force delete all files and subdirectories in the user's home directory and Home Directory)
7. delete a user from the group
Edit/etc/group, locate the GROUP1 line, and delete
Or use the command
Gpasswd-d A GROUP
8. Display User Information
Id user
Cat/etc/passwd
In linux, how does one delete a user from a group and how does one delete a user from a group:
Edit/etc/group and find GROUP1 to delete
Or use the command
Gpasswd-d A GROUP
Add a working group for existing users:
Usermod-G groupname username
Or: gpasswd-a user group
References: http://blog.sina.com.cn/s/blog_a6dcb5bd01017d0x.html
Which of the following users has the highest permissions in Linux? What are the Shell commands for adding new users and groups? Root Super privilege user
Add users and groups using useradd groupadd or adduser addgroup
When you directly modify the/etc/passwd/etc/group file, you can also add users and groups.
Never use Baidu to search for it. it will waste a lot of time.