LX0-103 · Question #102
Select the line that BEST represents what permissions the /etc/passwd file should have.
The correct answer is B. -rw-r--r-- 1 root root 531 Jun 5 22:45 /etc/passwd. The /etc/passwd file must be world-readable (permissions 644, owned by root) so all users and system processes can resolve account information.
Question
Select the line that BEST represents what permissions the /etc/passwd file should have.
Options
- A-rw------- 1 root root 531 Jun 5 22:45 /etc/passwd
- B-rw-r--r-- 1 root root 531 Jun 5 22:45 /etc/passwd
- C-rw-r--r-- 1 1 1 531 Jun 5 22:45 /etc/passwd
- DAll answers listed are not correct.
- EAll answers listed are correct.
How the community answered
(14 responses)- A7% (1)
- B86% (12)
- D7% (1)
Why each option
The /etc/passwd file must be world-readable (permissions 644, owned by root) so all users and system processes can resolve account information.
Permissions -rw------- (600) restrict read access to root only, which breaks any non-root process or utility that needs to read user account entries from the file.
Permissions -rw-r--r-- (octal 644) with root:root ownership are the correct and standard settings for /etc/passwd. The file must be readable by all users because many programs (login, id, ls) need to look up UID-to-username mappings, while write access is restricted to root only to prevent unauthorized modification of account data.
Although the permission bits are correct, the ownership fields display the numeric values '1 1' instead of the named account 'root root', indicating the file is not owned by the root user as required by convention and security policy.
This is incorrect because option B accurately represents the expected permissions and ownership for /etc/passwd.
Not all options are correct - options A and C each contain a distinct error in either permissions or ownership, so they cannot all be simultaneously correct.
Concept tested: Linux /etc/passwd correct file permissions and ownership
Source: https://man7.org/linux/man-pages/man5/passwd.5.html
Topics
Community Discussion
No community discussion yet for this question.