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 (xxx.xxx.xxx.xxx)
root      pts/1        2011-11-18 09:56 (xxx.xxx.xxx.xxx)
testuser  pts/2        2011-11-18 14:54 (xxx.xxx.xxx.xxx)
root      pts/3        2011-11-18 14:55 (xxx.xxx.xxx.xxx)

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

link|improve this question

78% accept rate
1  
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
feedback

2 Answers

up vote 1 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
link|improve this answer
And then kill that process using kill -9 <processid> – Mithun Nov 23 '11 at 5:05
feedback

Kill and Logout a User

You can send KILL single, type the following command:

# skill -KILL -u vivek

check these links for more information

http://www.cyberciti.biz/tips/howto-linux-kill-and-logout-users.html

http://www.serverschool.com/server-security/how-to-kill-a-user-session-on-a-linux-server/

link|improve this answer
what if I am logged in as the same user? – Mithun 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
feedback

Your Answer

 
or
required, but never shown

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