Are all Linux users present on / etc / passwd?

There is one user1 user that I cannot find in / etc / passwd, but I can execute cmds, for example

$touch abc
$chown user1 abc
$su user1

This command works fine, but if I try to use some really non-existent user, the chown and su commands do not work

I was wondering where this user1 comes from?

+4
source share
1 answer

During login with user1 (after su user1) do:

getent passwd $USER

Selects passwd user entries for different databases. All users are not necessarily system users — they can come from LDAP, etc. Check out the docs on getenv .

nsswitch.conf, , .

+3

Source: https://habr.com/ru/post/1694960/


All Articles