nerdexam
CompTIA

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.

Security

Question

Which of the following should the permission settings be for /etc/passwd and /etc/shadow?

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)
  • A
    87% (27)
  • B
    6% (2)
  • C
    3% (1)
  • D
    3% (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.

A/etc/passwd: -rw-r--r-- /etc/shadow: -r--------Correct

/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.

B/etc/passwd: -r-------- /etc/shadow: -rw-r--r--

`/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.

C/etc/passwd: -rw-r--r-- /etc/shadow: -rw-r--r--

`/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.

D/etc/passwd: -r-------- /etc/shadow: -r--------}

`/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

#file permissions#passwd file#shadow file#security

Community Discussion

No community discussion yet for this question.

Full LX0-104 Practice