代码改变世界

如何剔除linux在线用户

2013-03-10 22:30  小耳  阅读(347)  评论(0编辑  收藏  举报
1.查询当前登录用户
[root@firewall ~]# finger
Login     Name       Tty      Idle Login Time   Office     Office Phone
root      root       pts/0          May 4 23:19 (172.16.7.29)
 
2.查询某个登录用户的所有进程
[root@firewall ~]# ps -ef | grep pts/0
root      3140 2070 0 23:19 ?        00:00:00 sshd: root@pts/0
root      3142 3140 0 23:19 pts/0    00:00:00 -bash
root      3195 3142 0 23:24 pts/0    00:00:00 ps -ef
root      3196 3142 0 23:24 pts/0    00:00:00 grep pts/0
 
3.干掉登录用户Shell 进程
kill -9 3142