天天看點

pam_lastlog.so

OS version:Red Hat Enterprise Linux Server release 6.4

Kernel version:2.6.32-358.el6.x86_64

-------------------------------------------------------------------------

準備工作:

[root@Zhai tmp]# grep  PrintLastLog /etc/ssh/sshd_config

#PrintLastLog yes      

[root@Zhai tmp]# echo "PrintLastLog no" >> /etc/ssh/sshd_config

驗證silent:

[root@Zhai ~]# vi /etc/pam.d/sshd

#%PAM-1.0
auth            required        pam_permit.so
account         required        pam_unix.so
session         required        pam_lastlog.so silent      

[root@Zhai ~]# > /var/log/lastlog ;ll /var/log/lastlog

-rw-r--r--. 1 root root 0 Dec  4 00:57 /var/log/lastlog      
pam_lastlog.so

驗證never:

#%PAM-1.0
auth            required        pam_permit.so
account         required        pam_unix.so
session         required        pam_lastlog.so never      
-rw-r--r--. 1 root root 0 Dec  4 01:01 /var/log/lastlog      
pam_lastlog.so

驗證nodate:

#%PAM-1.0
auth            required        pam_permit.so
account         required        pam_unix.so
session         required        pam_lastlog.so nodate      
pam_lastlog.so

驗證noterm:

#%PAM-1.0
auth            required        pam_permit.so
account         required        pam_unix.so
session         required        pam_lastlog.so noterm      
pam_lastlog.so

驗證nohost:

#%PAM-1.0
auth            required        pam_permit.so
account         required        pam_unix.so
session         required        pam_lastlog.so nohost      
pam_lastlog.so

驗證inactive(auth):

#%PAM-1.0
# inactive:Invalid for root
auth            required        pam_permit.so
auth            required        pam_lastlog.so inactive=3
account         required        pam_unix.so
session         required        pam_loginuid.so      
pam_lastlog.so

驗證inactive(account):

#%PAM-1.0
# inactive:Invalid for root
auth            required        pam_permit.so
account         required        pam_lastlog.so inactive=3
account         required        pam_unix.so
session         required        pam_loginuid.so      
pam_lastlog.so

The detailed information:man pam_lastlog

繼續閱讀