Nov 1, 2018

How to logout a user forcely in Linux

Kill and Logout users in Linux

You terminate a session by killing its parent process, called the session leader. Find out which process it is with:

$ ps -dN|grep pts/3

Or

$ killall -u i88ca

Or

$ pkill -KILL -u i88ca

Kill and Logout users in pts/*


$ skill -KILL -v pts/1
This command will force logout and kill the user in pts/1. and the same user logged in pts/2 will not be logged out.

If need to kill a users all the connected sessions at once
$ skill -KILL -u i88ca          (this will kill both pts/1 and pts/2 cessions)

To STOP/PAUSE a user's activities
$ skill -STOP -u i88ca

To RESUME a stopped user
$ skill -CONT -u i88ca