View users and user groups in centos

View users and user groups in centos

 

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

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

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326394794&siteId=291194637