Tuesday, July 21, 2009

How do I logout Linux user?

Q. How do I logout Linux user?

A. root or admin user can logout any user forcefully. If you are logged in as vivek and just wanted to logout or logoff, type logout command or hit
CTRL+D:
$ logout

You will be logout of a login shell session or secure shell session.
Task: Linux logout user

If you would like to logout other users, you must login as root user. Next you need to use pkill command.
pkill command syntax

pkill -KILL -u {username}


To see list of logged in user type who or w command:
# who
OR
# w

To logout user called raj, enter:
# pkill -KILL -u raj
OR
$ sudo pkill -KILL -u raj

For more information read our article - Howto: Linux kill and logout users

1 comment: