How to Logout or Kill Other User’s Process in Ubuntu

So you want to force logout other user? Or you want to kill other user’s process? I’ve got a quick and dirty solution for you.

sudo pkill -KILL -u username

Don’t forget to replace the username with the user you want to be kill-ed. That command will kill all process owned by username.

You can also mention the specific process name if you want.

sudo pkill -KILL -u username gnome-session

That will kill only gnome-session process owned by username.