LFCS · Question #702
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 stores user account information and should be readable by all users but only writable by the root user to maintain system security and allow processes to look up user IDs.
Question
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
(40 responses)- A5% (2)
- B90% (36)
- C3% (1)
- E3% (1)
Why each option
The `/etc/passwd` file stores user account information and should be readable by all users but only writable by the root user to maintain system security and allow processes to look up user IDs.
The permissions `-rw-------` restrict reading for group and others, which would prevent many system processes and users from looking up user information, causing system functionality issues.
The permissions `-rw-r--r--` translate to read/write for the owner (root), and read-only for the group (root) and others. This configuration ensures that all users and processes can read user information, but only the `root` user can modify it, which is the standard and secure permission set for `/etc/passwd`.
While the permissions `-rw-r--r--` are correct, the ownership `1 1` (UID 1, GID 1) is incorrect; `/etc/passwd` must be owned by `root` (UID 0, GID 0) for proper system operation and security.
This is incorrect as option B is the correct representation of standard `/etc/passwd` permissions.
This is incorrect as only option B correctly represents the standard `/etc/passwd` permissions and ownership.
Concept tested: Linux file permissions for /etc/passwd
Source: https://man7.org/linux/man-pages/man5/passwd.5.html
Topics
Community Discussion
No community discussion yet for this question.