Wednesday, 14 August 2013


KILL REMOTE SSH SESSIONS

Do a w command to get the tty details of the session that you would like to terminate.

$ w
username pts/4 :0.0 12:35 1:13m 0.19s 24.44s gnome-terminal
username pts/6 :0.0 11:28 1:15m 0.43s 24.44s gnome-terminal
root pts/2 192.168.0.XX 16:26 0.00s 0.02s 0.00s w

In the above example, i have initiated another ssh session from 192.168.0.XX. To kill this session,
Find the PID of the process with

$ ps -ft pts/2
11236

$ kill -9 11236

This will terminate the remote session.

No comments:

Post a Comment