linuxbashshellsystem-administration

Does all linux users are present on /etc/passwd?


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?


Solution

  • 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 getent.

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