Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I When I logged into the machine as root and typed who to see which users are logged in, I found somebody else too logged in as root

devuser   pts/0        2011-11-18 09:55 (
root      pts/1        2011-11-18 09:56 (
testuser  pts/2        2011-11-18 14:54 (
root      pts/3        2011-11-18 14:55 (

How can I force a root user at pts/3 to logout?

share|improve this question
You've got an even bigger issue to resolve. Disable direct root logins, and force your users to use sudo. – Xenoactive Nov 20 '11 at 18:38
up vote 29 down vote accepted

You terminate a session by killing its parent process, called the session leader. Find out which process it is with:

ps -dN|grep pts/3
share|improve this answer
And then kill that process using kill -9 <processid> – Mithun Sreedharan Nov 23 '11 at 5:05

Kill and Logout a User

You can send KILL single, type the following command:

# skill -KILL -u vivek

check these links for more information

share|improve this answer
what if I am logged in as the same user? – Mithun Sreedharan Nov 18 '11 at 10:37
these command works for super user.. you must log in as super user.. network operating systems follow this approach for security.. i think those links are also saying same to login as admin.. – Niranjan Kala Nov 18 '11 at 10:44
it kicked me out as sudo su - too, even though i was root, but i guess i wasn't in the end. going back into the server showed me as the only one. i had 4 instances of myself, i guess I would say. – pjammer Sep 21 '12 at 18:28
@Mithun You can use -t <terminal name> instead of -u. – Melebius Jun 3 '14 at 6:42
Make sure that the user doesn't have the same UID as the root user or else you'll kick yourself out, too. – Steropes Oct 15 '14 at 0:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.