How do I terminate a user session under Linux?
The monitoring tool used by the company is cacti, and the setting in the threshold is the alarm when there are more than 2 logged-in users . So, my question comes out, how to terminate more user sessions? I myself is which user session , always can not oneself to terminate the conversation.
Step one: See which IP is on the operations server, who command
[email protected] ~]# who
Root Tty1 2014-04-20 08:42
Root pts/0 2014-04-20 09:10 (192.168.204.50)
Step two: See what sessions the server has (what are you doing ),w command
[Email protected] ~]# W
10:50:04 up 2:08, 2 users, Load average:0.00, 0.00, 0.00
USER TTY from [email protected] IDLE jcpu PCPU
Root tty1-08:42 1:40m 0.04s 0.04s-bash
Root pts/0 192.168.204.50 09:10 0.00s 0.07s 0.00s W
Step Three: view your session ID,TTY command
[[email protected] ~]# TTY
/dev/pts/0
Fourth step: Kill the session that is not in use,pkill-9-t tty1 or pkill-kill-t tty1
[Email protected] ~]# pkill-9-t Tty1
[Email protected] ~]# W
10:54:13 up 2:12, 1 user, Load average:0.00, 0.00, 0.00
USER TTY from [email protected] IDLE jcpu PCPU
Root pts/0 192.168.204.50 09:10 0.00s 0.07s 0.00s W
As a result, there is only one user session left.
This article is from the "Youth Deng Yong" blog, please be sure to keep this source http://dengyong.blog.51cto.com/8409869/1430411