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
Featured Articles:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- My 10 UNIX Command Line Mistakes
- Linux: 20 Iptables Examples For New SysAdmins

- 25 PHP Security Best Practices For Sys Admins
- The Novice Guide To Buying A Linux Laptop
- 10 Greatest Open Source Software Of 2009
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Linux Video Editor Software
Facebook it - Tweet it - Print it -


{ 9 comments… read them below or add one }
Thankssssss man !
Its one of things i hardly ever remember, never mind that i take the effort to write it down, but if you do need it a post like this is worth a million…
thanks
Works in OpenBSD 4.5 also. Great tip.
Whow, thanks for this posting! Just what I needed, highly appreciated!
Thanks, I was looking for such a command
i want to show the login time and logout time of all users then i will sort it according to their name help me pls…
Thanks a lot!
pkill worked fine in the GUI session!
Regards;
Thanks a lot.
I found here very usefull information about my quistions.
Best regards.
what’s the KILL flag do?