Linux系统下 如何强制踢掉其他登陆的用户
w或者who命令 ,查看机器中登陆的用户!# w
16:29:02 up 1 days,4:35,5 users,load average: 0.03, 0.05, 0.01
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/1 :0.0 Tue15 2days1:44 0.04s -bash
root pts/2 :0.0 Tue15 46:42m0.05s0.05s bash
root pts/3 :0.0 Tue15 2days0.02s0.02s bash
root pts/4 198.20.52.114 14:17 58:48 0.16s0.03s sqlplus
root pts/5 198.20.52.114 15:31 0.00s0.03s0.00s w
把pts/1踢掉(只有root才能去踢掉用户)
# pkill -kill -t pts/1
# pkill -kill -t pts/2
# pkill -kill -t pts/3
查看是不是踢掉
# w
16:34:16 up 2 days,2:40,2 users,load average: 0.00, 0.05, 0.02
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/4 172.20.52.114 14:17 1:04m0.16s0.03s sqlplus
root pts/5 172.20.52.114 15:31 0.00s0.03s0.00s w
root可以踢掉其他用户包括自己 pkill -kill -t
页:
[1]