nerdexam
CompTIA

LX0-104 · Question #417

On a new Linux system, the root user is being asked to provide the root user password before being able to use the su command. What line in the /etc/pam.d/su file will allow root to use su without sup

The correct answer is D. auth sufficient pam_rootok.so. To allow the root user to use the su command without a password, the /etc/pam.d/su file needs to include auth sufficient pam_rootok.so, which checks if the calling user is root and, if so, grants immediate success without further authentication.

Security

Question

On a new Linux system, the root user is being asked to provide the root user password before being able to use the su command. What line in the /etc/pam.d/su file will allow root to use su without supplying passwords?

Options

  • Aauth required pam_norootpw.so
  • Bauth sufficient pam_norootpw.so
  • Cauth required pam_rootok.so
  • Dauth sufficient pam_rootok.so

How the community answered

(62 responses)
  • A
    3% (2)
  • B
    6% (4)
  • C
    2% (1)
  • D
    89% (55)

Why each option

To allow the root user to use the `su` command without a password, the `/etc/pam.d/su` file needs to include `auth sufficient pam_rootok.so`, which checks if the calling user is root and, if so, grants immediate success without further authentication.

Aauth required pam_norootpw.so

The `pam_norootpw.so` module does not exist, and `required` would still demand other authentication methods if `pam_rootok.so` wasn't present or sufficient.

Bauth sufficient pam_norootpw.so

The `pam_norootpw.so` module does not exist in PAM.

Cauth required pam_rootok.so

Using `auth required pam_rootok.so` would ensure that `pam_rootok.so` must succeed, but `required` modules still allow subsequent modules in the stack to fail authentication, which might still trigger a password prompt if another module is configured to do so for root.

Dauth sufficient pam_rootok.soCorrect

The `pam_rootok.so` module checks if the current user ID is 0 (root); if it is, the module returns PAM_SUCCESS, and when used with the `sufficient` control flag, it satisfies the authentication requirements without prompting for a password, allowing root to `su` to other users directly.

Concept tested: PAM su root authentication

Source: https://linux.die.net/man/8/pam_rootok

Topics

#PAM#su command#authentication#root privileges

Community Discussion

No community discussion yet for this question.

Full LX0-104 Practice