LFCS · Question #764
On a system using shadowed passwords, the correct permissions for /etc/passwd are ___ and the correct permissions for /etc/shadow are ___.
The correct answer is C. rwrr, r. For security, /etc/passwd needs to be readable by all users but only writable by root, while /etc/shadow must be readable and writable only by root.
Question
Options
- Arwr, r
- Brwrr, rrr
- Crwrr, r
- Drwrrw,rr
- Erw, r
How the community answered
(26 responses)- A8% (2)
- B4% (1)
- C88% (23)
Why each option
For security, `/etc/passwd` needs to be readable by all users but only writable by root, while `/etc/shadow` must be readable and writable only by root.
`rwr` (624) for `/etc/passwd` incorrectly grants group write permissions, and `r` (400) for `/etc/shadow` only allows root to read, not write.
`rrr` (444) for `/etc/shadow` incorrectly grants read permissions to all, compromising password security.
The correct permissions for `/etc/passwd` are `rw-r--r--` (644), allowing all users to read it for essential user information but only root to modify. The correct permissions for `/etc/shadow` are `r--------` (400), ensuring only the root user can read and write the hashed passwords, maintaining security.
`rwrrw` (666) for `/etc/passwd` incorrectly grants write permissions to all, a severe security flaw, and `rr` (440) for `/etc/shadow` incorrectly grants read permission to the group.
`rw` (600) for `/etc/passwd` incorrectly restricts read access for other users, hindering normal system operations.
Concept tested: File permissions for /etc/passwd and /etc/shadow
Source: https://docs.oracle.com/cd/E37670_01/E37671/html/ol_passwd.html
Topics
Community Discussion
No community discussion yet for this question.