查看當前登陸機器linux
[root@linux01 ~]# w 11:08:21 up 1:47, 2 users, load average: 0.00, 0.01, 0.05 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT root pts/0 192.168.111.1 09:21 5.00s 0.14s 0.00s w root pts/1 192.168.111.129 11:08 8.00s 0.00s 0.00s -bash
從信息中可知用戶用tty爲pts/1登陸系統,執行強制退出命令bash
[root@linux01 ~]# pkill -kill -t pts/1
這樣能夠強制遠程用戶下線哦~code