CentOS User Management

Deleting user


userdel -rf angie


will delete the information under user /etc/passwd; /etc/group, and delete /home/username.

If it is just userdel angie, only /etc/passwd; information under /etc/group will be deleted, not Delete the "/home/username" directory How to

view users and user groups

User list file: /etc/passwd
User group list file: /etc/group


View which users are in the system: cut -d : -f 1 /etc/ passwd
View users who can log in to the system: cat /etc/passwd | grep -v /sbin/nologin | cut -d : -f 1
View user operations: w command (requires root privilege)
View a user: w username
View login User: who
View user login history: last

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326987322&siteId=291194637