Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAM: Update lastlog when using su? #65

Open
pyllyukko opened this issue Dec 31, 2019 · 0 comments
Open

PAM: Update lastlog when using su? #65

pyllyukko opened this issue Dec 31, 2019 · 0 comments
Labels
PAM Linux-PAM related

Comments

@pyllyukko
Copy link
Owner

CentOS has this in /etc/pam.d/postlogin-ac (which is included from /etc/pam.d/su):

session     [success=1 default=ignore] pam_succeed_if.so service !~ gdm* service !~ su* quiet debug
session     [default=1]   pam_lastlog.so nowtmp showfailed
session     optional      pam_lastlog.so silent noupdate showfailed

So it will update lastlog (but not wtmp) when su is used.

SU(1):

NOTES
       For  security  reasons su always logs failed log-in attempts to the btmp file, but it does not write to the lastlog file at all.  This solution al‐
       lows to control su behavior by PAM configuration.  If you want to use the pam_lastlog module to print warning message about failed log-in  attempts
       then the pam_lastlog has to be configured to update the lastlog file as well. For example by:

              session  required  pam_lastlog.so nowtmp
@pyllyukko pyllyukko added the PAM Linux-PAM related label Dec 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PAM Linux-PAM related
Projects
None yet
Development

No branches or pull requests

1 participant