0

When I do cat /etc/passwd I see multiple users but when I type in ls -l /home I can see only two users in it.

How to check the issue.

3
  • You may find this helpful: What's the difference between a normal user and a system user? Commented Jan 18, 2024 at 5:22
  • Can you also see those user's home directories in the output of cat /etc/passwd? Commented Jan 18, 2024 at 5:25
  • 7
    Not all users have home directories inside /home. Also, users do not have to come from /etc/passwd. If you provide some context as to what you are attempting to achieve, we may be able to provide some solutions. Commented Jan 18, 2024 at 6:03

1 Answer 1

1
  1. The second last field in /etc/passwd is the users home directory - this can be elsewhere

  2. Root's home directory is usually in /root (because root needs to be able to access when stuff is broken and /home may be on a different drive)

  3. as per comments, system accounts should NOT have a home directory in /home - they are subject to different security rules and perform different functions than human beings.

  4. I have seen instances where a system account has their home dir configured as /home but no directory exists (e.g. syslog on WSL Ubuntu). That's not an issue because this user never logs in / never has interactive sessions

  5. Its quite possible to provision a (normal) user account without creating the home directory at the same time.....but have the home directory created the first time the user logs in - this is does with a PAM module.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.