shadow_man
Executive Member
http://jerome.co.za/nix-tips-killing-old-shell-sessions/
*NIX TIPS – KILLING OLD SHELL SESSIONS
Perhaps you’ve been hacked and need to boot the rogue user off your server
or
Perhaps you want to kick off a colleague who’s influencing your session and prohibiting your work.
To check who’s logged in:
use:
or
Now you’ll see the results mention session numbers e.g. pts/0 BUT they don’t mention process id’s – so how do we kill their sessions?
Well we do this by:
Take note of the PPID and kill the session:
Now, you’ve gotten rid of the rogue users SSH session and can continue in peace.
*NIX TIPS – KILLING OLD SHELL SESSIONS
Perhaps you’ve been hacked and need to boot the rogue user off your server
or
Perhaps you want to kick off a colleague who’s influencing your session and prohibiting your work.
To check who’s logged in:
use:
Code:
who
root@server:/nas/file_storage# who
root pts/0 2014-01-06 10:36 (ws2.host.local)
root pts/1 2014-01-08 16:23 (ws2.host.local)
or
Code:
finger
root@server:/nas/file_storage# finger
Login Name Tty Idle Login Time Office Office Phone
root root *pts/0 14d Jan 6 10:36 (ws2.host.local)
root root *pts/1 23:43 Jan 8 16:23 (ws2.host.local)
root root *pts/2 Jan 13 17:25 (ws2.host.local)
Now you’ll see the results mention session numbers e.g. pts/0 BUT they don’t mention process id’s – so how do we kill their sessions?
Well we do this by:
Code:
ps -ft pts/0
root@server:/nas/file_storage# ps -ft pts/0
UID PID PPID C STIME TTY TIME CMD
root 32247 32109 0 Jan06 pts/0 00:00:02 -bash
Take note of the PPID and kill the session:
Code:
kill -9 32109
Now, you’ve gotten rid of the rogue users SSH session and can continue in peace.