Skip to content
Advertisement

Does all linux users are present on /etc/passwd? [closed]

There is one user “user1” which I cant find in /etc/passwd but I can execute cmds like

$touch abc
$chown user1 abc
$su user1

These command runs fine, but if I try to chown to some really nonexistent user these chown and su commands fail

I was wondering where is this user1 coming from?

Advertisement

Answer

While logged in with user1 (after su user1) execute:

getent passwd $USER

This fetches user passwd entries across different databases. All users are not necessarily system users – they can come from LDAP etc. Check docs on getenv.

Also check your nsswitch.conf to see all sources used to obtain name-service information.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement