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?
1 Answer
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...
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 throughlibnss-extrausers
or via LDAP etcgetent passwd
is for....and is whygetent
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.