Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

We have a handful of users that login to our Linux virtual machine as root either through the vSphere client or through SSH and I want to see if there is a way to tell if multiple root users are logged in at the same time.

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

You can use who command to find out all the logged in users. There is w command also available to find out the same.

share|improve this answer
    
I don't think "who" or "w" will show multiple root users logged in. You can also use "users" –  DemiSheep Feb 14 '13 at 19:16
    
Try it for yourself. w and who both show one line per root session and the hostname/ip that they are logged in from. –  Stefan Lasiewski Feb 14 '13 at 21:33
2  
Note: that in many cases remote rsh and remote xterm users will not appear in who, w .... so you can't fully depend on this. –  mdpc Feb 14 '13 at 22:06
    
But shouldn't they be visible in any case in last | head x which reads from wtmp? You could use last | head -n 100 | grep root | grep "still logged in" though that might also return roots that have already logged out some minutes ago. –  Karma Fusebox Feb 15 '13 at 0:50
    
Ok I tested this with a coworker and "w" "who" and "users" all show multiple root accounts. Thanks! –  DemiSheep Feb 18 '13 at 14:08
add comment

Your Answer

 
discard

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.