Total Pageviews

Friday, 17 February 2012

Linux下,强制踢掉已登陆的用户

查看机器中登陆的用户
bioinfo@bioinfo:~$ w
21:23:30 up 8 days, 12:58,  4 users,  load average: 40.23, 40.27, 40.27
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
bioinfo  pts/0    bisncp           21:21    0.00s  0.14s  0.01s w
bioinfo  pts/1    bisncp           21:22    1:11   0.13s  0.13s -bash
bioinfo  pts/2    bisncp           21:22   29.00s  0.13s  0.13s -bash
root     pts/3    chempip1         21:22   41.00s  0.01s  0.01s -bash
把pts/1 pts/2 pts/3 踢掉
pkill -kill -t pts/1
pkill -kill -t pts/2
sudo pkill -kill -t pts/3 (root用户得用root来kill)
查看是不是踢掉
bioinfo@bioinfo:~$ w
21:24:26 up 8 days, 12:59,  1 user,  load average: 40.18, 40.25, 40.26
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
bioinfo  pts/0    bisncp           21:21    0.00s  0.15s  0.01s w
root可以踢掉其他用户包括自己.

No comments:

Post a Comment