Red Hat Bugzilla – Bug 154030
pam_nologin locks out root as well as nonroot users
Last modified: 2015-01-07 19:09:38 EST
Description of problem:
According to past experience and the current pam documetation, the presense of a /etc/nologin file should prevent nonroot logins but still permit root access. However, this does not appear to be the case.
Version-Release number of selected component (if applicable):
Always. To reproduce:
1) Create /etc/nologin
2) Attempt to login as root via a virtual console. Access will be denied. For any user a line like the following will be appended to /var/log/secure:
Apr 5 21:04:54 marco login: Please ignore underlying account module
Note that ssh logins as root will still succeed. This is because sshd handles interpretation of /etc/nologin internally and ignores the pam_nologin reference in /etc/pam.d/sshd (so I think that line might be superfluous).
I will attach an strace and an ltrace of a mingetty instance failing to allow root access while /etc/nologin exists. The problem appears to be in pam_setcred(), near the end of the ltrace. However, I can't troubleshoot it much beyond that.
Created attachment 112766 [details]
Strace of mingetty denying root access while /etc/nologin exists
Created attachment 112767 [details]
ltrace of mingetty denying root access when /etc/nologin exists
Sorry about the formatting. So much for my experiment with using links. =:\
duplicate of bug 143750
Patch is already included in the scheduled pam update for U1.
*** Bug 155357 has been marked as a duplicate of this bug. ***