网站技术 · 2012 年 05 月 17 日 0

查看centos中的用户和用户组

cat /etc/passwd 查看用户列表

cat /etc/group 查看用户组列表

  • 查看系统中有哪些用户:cut -d : -f 1 /etc/passwd
  • 查看可以登录系统的用户:cat /etc/passwd | grep -v /sbin/nologin | cut -d : -f 1
  • 查看用户操作:w命令(需要root权限)
  • 查看某一用户:w 用户名
  • 查看登录用户:who
  • 查看用户登录历史记录:last