LX0-104 · Question #265
Which of the following should the permission settings be for /etc/passwd and /etc/shadow?
The correct answer is A. /etc/passwd: -rw-r--r-- /etc/shadow: -r--------. The correct permission settings for /etc/passwd allow global readability but restricted write access, while /etc/shadow is strictly readable only by the root user for security.
Question
Options
- A/etc/passwd: -rw-r--r-- /etc/shadow: -r--------
- B/etc/passwd: -r-------- /etc/shadow: -rw-r--r--
- C/etc/passwd: -rw-r--r-- /etc/shadow: -rw-r--r--
- D/etc/passwd: -r-------- /etc/shadow: -r--------}
How the community answered
(31 responses)- A87% (27)
- B6% (2)
- C3% (1)
- D3% (1)
Why each option
The correct permission settings for `/etc/passwd` allow global readability but restricted write access, while `/etc/shadow` is strictly readable only by the root user for security.
/etc/passwd` needs to be readable by all users so that tools and applications can map UIDs to usernames for various system functions, but it should only be writable by root. `/etc/shadow` contains sensitive hashed password information, making it imperative that it is readable only by the root user to prevent unauthorized access and protect user credentials.
`/etc/passwd` must be readable by all users for system functionality, and `/etc/shadow` should not be writable by anyone other than root, if at all, to prevent security compromises.
`/etc/shadow` should never be readable by all users due to its highly sensitive content (hashed passwords), which would pose a severe security risk if exposed.
`/etc/passwd` needs to be readable by all users for proper system operation, and `/etc/shadow` must not be readable by all users due to its sensitive nature.
Concept tested: Linux file permissions for sensitive system files
Source: https://man7.org/linux/man-pages/man5/passwd.5.html
Topics
Community Discussion
No community discussion yet for this question.