There was a problem loading the comments.

How to kill SSH user sessions

Support Portal  »  Knowledgebase  »  Viewing Article

  Print
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.

 
[[email protected] ~]# w
 09:55:07   up  1  day,   5:55,   2 users,   load average:   0.96,   0.70,   0.39
 USER    TTY      FROM                            [email protected]    IDLE     JCPU    PCPU    WHAT
 root        pts/1    117.204.126.190           09:27           1:30      0.00s     0.00s    -bash
 root        pts/2    136.243.108.213          09:55           0.00s   0.00s      0.00s    w
 [[email protected] ~]#

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 117.204.126.190.

That’s it!

Share via

Related Articles

Copyright © 2023 TheGigabit. All right reserved. Reg.No: 200701034297 (792326-P)