Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 154030 - pam_nologin locks out root as well as nonroot users
pam_nologin locks out root as well as nonroot users
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: pam (Show other bugs)
All Linux
medium Severity high
: ---
: ---
Assigned To: Tomas Mraz
Jay Turner
: 155357 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2005-04-06 13:28 EDT by Brad Smith
Modified: 2015-01-07 19:09 EST (History)
2 users (show)

See Also:
Fixed In Version: pam-0.77-66.5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-06-16 07:04:22 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Strace of mingetty denying root access while /etc/nologin exists (110.09 KB, text/plain)
2005-04-06 13:30 EDT, Brad Smith
no flags Details
ltrace of mingetty denying root access when /etc/nologin exists (91.01 KB, text/plain)
2005-04-06 13:31 EDT, Brad Smith
no flags Details

  None (edit)
Description Brad Smith 2005-04-06 13:28:29 EDT
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):

How reproducible:
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[3570]: 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.
Comment 1 Brad Smith 2005-04-06 13:30:15 EDT
Created attachment 112766 [details]
Strace of mingetty denying root access while /etc/nologin exists
Comment 2 Brad Smith 2005-04-06 13:31:24 EDT
Created attachment 112767 [details]
ltrace of mingetty denying root access when /etc/nologin exists
Comment 3 Brad Smith 2005-04-06 13:33:01 EDT
Sorry about the formatting. So much for my experiment with using links. =:\
Comment 4 Tomas Mraz 2005-04-06 13:45:07 EDT
duplicate of bug 143750

Patch is already included in the scheduled pam update for U1.
Comment 5 Tomas Mraz 2005-04-19 11:25:31 EDT
*** Bug 155357 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.