linux查看当前登陆用户和踢除正在登陆的其他用户
查看当前登陆的用户
[root@Action ~]# who
root pts/1 2015-12-03 16:44 (113.31.72.140)
root pts/0 2015-12-03 09:09 (113.31.72.140)
查看用户登陆占用的进程
[root@Action ~]# ps -ef|grep pts/0
root 5673 887 0 09:09 ? 00:00:00 sshd: root@pts/0
root 5675 5673 0 09:09 pts/0 00:00:00 -bash
root 6053 6030 0 16:45 pts/1 00:00:00 grep pts/0
杀掉进程
[root@Action ~]# kill -9 5673
再查看
[root@Action ~]# ps -ef|grep pts/0
root 6055 6030 0 16:46 pts/1 00:00:00 grep pts/0
[root@Action ~]# who
root pts/1 2015-12-03 16:44 (113.31.72.140)
已有 0 条评论