關閉某個登陸用戶

[root@localhost ~]# wpython

 20:26:02 up  3:13,  3 users,  load average: 0.00, 0.00, 0.00bash

USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHATssh

root     tty1     -                17:14    3:08m  0.07s  0.07s -bashide

root     pts/0    192.168.18.20    20:16    2:35   0.44s  0.40s /usr/bin/python /usr/bin/yum install dhcpit

root     pts/1    192.168.18.20    20:25    0.00s  0.03s  0.01s wclass


pts/0終端的任務卡死、若要結束該任務、先獲取該終端的PID登錄

[root@localhost ~]# ps -ef|grep pts/0終端

root      4313  3399  0 20:16 ?        00:00:00 sshd: root@pts/0 grep

root      4315  4313  0 20:16 pts/0    00:00:00 -bashyum

root      4362  4315  0 20:23 pts/0    00:00:00 /usr/bin/python /usr/bin/yum install dhcp

root      4426  4368  0 20:29 pts/1    00:00:00 grep pts/0

kill 4362便可結束該任務


關閉某個登陸的用戶

[root@localhost ~]# echo "i will close you" > /dev/pts/0   (該用戶會收到消息)

[root@localhost ~]# fuser -k /dev/pts/0

/dev/pts/0:           4315

相關文章
相關標籤/搜索