How to logout the user from Centos?

Hi Guys,

Please assume, am login with root in my local server via ssh from remote location, am not logged out from that session(tty- pts/0),

Again I logged the same from another remote location (tty-pts/1), the previous login is still alive … by executing the command “w”

see the below screen shot, I want to log out the session of (22.33.44.55)

Please advice thanks in advance guys.

You can use this command:

kill -9 `ps aux | grep 'pts/0' | grep ssh | awk {' print $2 '}`

Change pts/0 to whichever you want.

1 Like

@modserv

Its working thanks for your command :grinning:

thank you !!!

1 Like