Linux强制用户下线
强制用户下线,首先得有root的权限
1. [root@centos etc]# w
2. 21:49:02 up 1:38, 3 users, load average: 0.01, 0.02, 0.00
3. USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
4. root tty1 - 20:10 1:28m 0.07s 0.07s -bash
5. root pts/0 192.168.204.1 20:27 1.00s 0.20s 0.05s w
6. advisen pts/1 192.168.204.1 21:44 2:58 0.02s 0.11s sshd: advisen [
7. [root@centos etc]#
或
1. [root@centos etc]# who
2. root tty1 2017-02-25 20:10
3. root pts/0 2017-02-25 20:27 (192.168.204.1)
4. advisen pts/1 2017-02-25 21:44 (192.168.204.1)
5. [root@centos etc]#
1. [root@centos etc]# pkill -kill -t pts/1
2. [root@centos etc]# w
3. 21:51:32 up 1:40, 2 users, load average: 0.00, 0.01, 0.00
4. USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
5. root tty1 - 20:10 1:30m 0.07s 0.07s -bash
6. root pts/0 192.168.204.1 20:27 0.00s 0.15s 0.00s w
7. [root@centos etc]#
pkill -kill -t TTY值
用pkill -kill -t pts/1 命令
Linux强制用户下线
https://www.hechunyu.com/archives/linuxqiang-zhi-yong-hu-xia-xian