linux 踢出在线用户

两个步骤:

1.用w命令找到要踢出的用户,比如下面:

 

[root@localhost ~]# w
 18:16:55 up 39 days,  8:27,  3 users,  load average: 0.03, 0.03, 0.00
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
root     pts/0    61.130.130.130   18:16    2.00s  0.00s  0.00s -bash
root     pts/1    61.130.130.130   18:07   44.00s  0.03s  0.03s -bash
root     pts/2    61.130.130.130   18:16    0.00s  0.01s  0.00s w
 

 

2.运行pkill命令踢出该登录用户,比如,我要踢出上面的pts/2,则运行

 

[root@localhost ~]# pkill -kill -t pts/2

你可能感兴趣的:(linux)