How to kill SSH user sessions
Please use the following commands to kill SSH user sessions. First you need to check how many users are logged into the server by w command.
[root@test ~]# w 09:55:07 up 1 day, 5:55, 2 users, load average: 0.96, 0.70, 0.39 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT root pts/1 18.104.22.168 09:27 1:30 0.00s 0.00s -bash root pts/2 22.214.171.124 09:55 0.00s 0.00s 0.00s w [root@test ~]#
You can find two SSH user sections on the server. Then, you can kill the desired SSH user session using the name of the terminal console (tty). Please use the following command.
pkill -9 -t pts/1
The above command will kill the SSH user session from the IP 126.96.36.199.
If you like this post and wish to receive more articles from us, please like our FB page: Grepitout
Your suggestions and feedbacks will encourage us and help to improve further, please feel free to write your comments.
For more details on our services, please drop us an E-mail at firstname.lastname@example.org