The blog provides Network Security Tips, Tricks, How To/Procedures. Products and areas not limited to Firewalls, Security, Check Point, Cisco, Nokia IPSO, Crossbeam, SecurePlatform, SPLAT, IP Appliance, GAiA, Unix/Linux.

Linux/Unix - Kill or Terminate Logged In User Session

Execute command "who" to view the list of currently logged in user session in Linux/Unix, then execute "pkill -9 -u <username>" to kill or terminate particular user session. This command comes handy especially when you want to kill a hung user session.


Syntax:

who
pkill -9 -u <username>



Example:


[root@UnixSystem]#
[root@UnixSystem]# who
john pts/0        2014-10-11 21:11 (10.20.200.15)
jane  pts/2        2014-07-19 17:06 (10.20.200.11)
harry  pts/3        2014-07-19 17:30 (10.20.201.10)
tom  pts/4        2014-07-20 01:44 (10.20.200.11)
[root@UnixSystem]#
[root@UnixSystem]# kill -9 -u john

[root@UnixSystem]#
[root@UnixSystem]# who
jane  pts/2        2014-07-19 17:06 (10.20.200.11)
harry  pts/3        2014-07-19 17:30 (10.20.201.10)
tom  pts/4        2014-07-20 01:44 (10.20.200.11)
[root@UnixSystem]#


Linux/Unix - Kill or Terminate Logged In User Session Linux/Unix - Kill or Terminate Logged In User Session Reviewed by Admin on 14:02:00 Rating: 5