-2

If I have the IP address of a computer running Linux is it possible to see which user accounts exist on that computer, without having to ssh into it first?

3
  • 4
    Now, wouldn't that make life so much easier for the bad guys? May 31 '16 at 11:25
  • Even if you can ssh into a system, that is not enough. You can investigate /etc/passwd, but if you cannot see how PAM is set up on the system you'll be missing other user accounts added through libnss-extrausers or via LDAP etc
    – Anthon
    May 31 '16 at 12:12
  • @Anthon that's what getent passwd is for....and is why getent should be used in scripts that need to check usernames. groupnames, etc instead of simply grepping the first field of /etc/passwd, /etc/group and so on.
    – cas
    Jun 1 '16 at 1:13
2

Nowadays, on a correctly-configured system there shouldn't be any way of determining this.

On a badly-configured system, you might see different behaviour when attempting to log in depending on whether the user you're trying to log in as exists or not. (Hopefully not in the messages returned, but perhaps in the timing of the responses.)

In the past, finger would have told you:

finger @host

But those days are long gone...

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.