Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

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

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
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
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

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.