linux终止用户会话
 
代码  
[root@fengtest2 ~]# w  
 17:26:04 up 1 day,  1:55,  2 users,  load average: 0.00, 0.00, 0.00  
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT  
root     pts/1    192.168.200.1    17:26    0.00s  0.00s  0.00s w  
root     pts/2    192.168.200.1    17:12    1:07   0.03s  0.03s -bash  
 
Java代码  
[root@fengtest2 ~]# pkill -9 -t pts/1  
 
Java代码  
[root@fengtest2 ~]# w  
 17:27:51 up 1 day,  1:57,  1 user,  load average: 0.00, 0.00, 0.00  
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT  
root     pts/2    192.168.200.1    17:12    0.00s  0.03s  0.00s w