Does all linux users are present on /etc/passwd? [closed]
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.