Search This Blog

Thursday, June 14, 2012

Force user to logoff from remote or any terminal

So at times it may happen the a user logs in from remote terminal and forgets to log off. So in order to kill such a session of a remote user, following things can be done.
# who -u
This will give you the pid of the process user is using to log in.
Then you can kill that process using
#kill -9 pid

1 comment:

Anonymous said...

You can just use the 'w' command to list who's logged in. That gives a list of the tty's. Then use pkill to hangup the connection

pkill -HUP -t pts/1