LFCS · 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--------. File permissions for /etc/passwd allow all users to read basic account information, while /etc/shadow is restricted to root-only read access to protect password hashes.
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
(59 responses)- A90% (53)
- B2% (1)
- C7% (4)
- D2% (1)
Why each option
File permissions for /etc/passwd allow all users to read basic account information, while /etc/shadow is restricted to root-only read access to protect password hashes.
The /etc/passwd file requires `-rw-r--r--` (octal 644) permissions, allowing the owner (root) to read/write, and other users to read it, which is necessary for many system utilities. The /etc/shadow file, containing sensitive password hashes, must have `-r--------` (octal 400) permissions, restricting read access exclusively to the root user for security.
This option incorrectly restricts /etc/passwd to root-only read, which breaks common system functionality, and grants too much read/write access to /etc/shadow.
This option grants read and write access to /etc/shadow to all users, which is a severe security vulnerability.
This option restricts /etc/passwd to root-only read, which would prevent many services and users from functioning correctly, and provides correct but incomplete permissions for shadow.
Concept tested: /etc/passwd and /etc/shadow permissions
Source: https://man7.org/linux/man-pages/man5/passwd.5.html
Topics
Community Discussion
No community discussion yet for this question.