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.


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

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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