who
Linux 查看用户, 当前登录用户, 登录日志 # 查看 ssh 上已经连接的用户、session # 查看登录用户正在使用的进程信息 w who who -a netstat -tnpa | grep ‘ESTABLISHED.*sshd’ ps auxwww | grep sshd: ps ax | grep sshd /etc/shadow 和 /etc/passwd 系统存在的所有用户名 more /var/log/secure who /var/log/wtmp 干了些什么? root账户下输入su - username 切换到username下输入 history 能看到这个用户历史命令,默认最近的1000条 http://blog.csdn.net/wudiyi815/article/details/8061459 作为系统管理员,你可能经常会 (在某个时候) 需要查看系统中有哪些用户正在活动。有些时候,你甚至需要知道他 (她) 们正在做什么。本文为我们总结了4种查看系统用户信息 (通过编号 (ID) ) 的方法。 w w命令用于显示已经登录系统的用户的名称,以及他们正在做的事。该命令所使用的信息来源于/var/run/utmp文件。w命令输出的信息包括: USER 用户名称 tty 用户的机器名称或tty号 FROM 远程主机地址 LOGIN@ 用户登录系统的时间 IDLE 空闲时间, 时间格式: 22:29m(22h29m), 46.00s, 27:47(27m47s) JCPU 附加到 tty (终端) 的进程所用的时间 PCPU 当前进程所用时间 WHAT 用户当前正在使用的命令 IDLE The idle time is supposed to tell how long it has been since the user typed any input on that terminal. For Xwindows sessions, it is broken since Xwindows never reads input from a terminal, but instead gathers input directly from your mouse and keyboard, so the terminal never gets its timestamp updated since it is never read from. ...