Ubuntu – How to log off an user from SSH?

ssh

I am able to see logged-in users via the who or last command.

How can I log off a particular user who login through SSH?

Best Answer

kill its ssh session. Check them by

ps aux | egrep "sshd: [a-zA-Z]+@"

Second column gives you the PID. Then,

sudo kill [-9] PID

Hope this helps.

ps: using the -9 flag will prevent things from stopping "graciously".

Related Question