How to kill a user session

First find who is logged in:

stelios@amilo:~> w
 14:05:24 up  1:28,  2 users,  load average: 0.26, 0.37, 0.36
USER     TTY        LOGIN@   IDLE   JCPU   PCPU WHAT
stelios  tty7      12:37     ?     1:40   0.35s /usr/bin/gnome-session
stelios  pts/0     14:01    0.00s  0.06s  0.02s w
stelios@amilo:~>

Assume that you want to kill user stelios. Run: ps -fu stelios you will see something like:

stelios@amilo:~> ps -fu stelios
UID        PID  PPID  C STIME TTY          TIME CMD
stelios   4757     1  0 12:37 ?        00:00:00 /usr/bin/gnome-keyring-daemon --
stelios   4789  3685  0 12:37 ?        00:00:00 /usr/bin/gnome-session

Just send a kill -hup pid and user will be disconnected. In our example that is kill -HUP 4757 and so on.

Posted on: 31/01/2010








0 Comments
If you want to leave a comment please Login or Register