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.
Question
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)- A3% (2)
- B6% (4)
- C2% (1)
- D89% (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.
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.
The `pam_norootpw.so` module does not exist in PAM.
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.
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
Community Discussion
No community discussion yet for this question.