1: View all groups of users
Cat /etc/group
ftpgroup:x:1001:ftpadmin
Ftpgroup is a user group and ftpadmin is a user of this group
1) Create user groups
Groupadd Ftpgroup
2) Delete user group
Groupdel Ftpgroup
2: View Users
Cat/etc/shadow
ftpadmin:$6$8qc/zlcz$zan/ Nx.dg5o4lb87z86gpsmnhvghdynvc1tt0m.nraurw.5rfrfowj9ngp6gpzuwqvmjrihx.. Hd7awpyjzuy/:15678:0:99999:7:::
Ftpadmin is the user name
1) Create user
Useradd ftpadmin-d/usr/local/tomcat/apache-tomcat-7.0.33/webapps/-G ftpgroup
passwd ftpadmin //Set Password
-d Specifies the user's home directory
The group to which-G belongs.
But when I performed cat/user/group, I found that there was no user ftpadmin
FTPGROUP:X:1001:
So I executed 3 of the instructions I wrote.
2) Delete User
Userdel Ftpadmin
3: Add the user to the specified user group
Gpasswd-a ftpadmin ftpgroup
Adding user ftpadmin to group Ftpgroup
4: View the user and the user's home directory and other information
VI /etc/passwd
User
Ftpadmin:x:1001:1001::/usr/local/tomcat/apache-tomcat-7.0.33/webapps/:/sbin/nologin