Server Fault is a question and answer site for system and network administrators. 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

Possible Duplicate:
How to know what user belongs to what ip on debian

Is there a way to see a list of all current logged in user on a Debian server? Sometimes it is very useful to do so, e.g. before updating certain plugins etc.

Any software or built-in features? All users will log in through ssh.

share|improve this question

marked as duplicate by Iain Feb 15 '12 at 13:49

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

what do you mean with Debain Apache server? Do you want to know the system users or users which are currently visiting a website? – reox Feb 15 '12 at 10:25
I'm sorry that was a bit inaccurate. I mean a debian server, and users who are logged into that server. Edited post. – cherrun Feb 15 '12 at 10:44
Sounds familiar. – jscott Feb 15 '12 at 11:06
up vote 6 down vote accepted

use the who command. It will show you the username and the terminal/pseudo terminal that they are using, as well as what time they logged in:

    migs     pts/0        2012-02-15 17:46 (:0)
    migs     pts/1        2012-02-15 17:46 (:0)
    migs     pts/2        2012-02-15 17:48 (:0)

Mine shows three instances of me because I've got two terminal windows open, plus my log-in to the box.

You could also use the last command. This will show the most recently logged in people, as well as currently logged in users.

    migs     pts/2        :0               Wed Feb 15 17:48   still logged in   
    migs     pts/1        :0               Wed Feb 15 17:46   still logged in   
    migs     pts/0        :0               Wed Feb 15 17:46   still logged in
share|improve this answer
Nice! Didn't know such commands existed. Does the 'last' command have a limit or will it print out all users who have ever logged in? – cherrun Feb 15 '12 at 10:39
it will display all log-ins from up to the date the /var/log/wtmp file got rotated. You can check the other wtmp files in /var/log with the -f switch. – Migs Feb 15 '12 at 10:45

The who command will do the job and show all users logged in.

share|improve this answer
Migs answer was a little more accurate. Anyway, thanks! – cherrun Feb 15 '12 at 10:38

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