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_第1张图片




验证never:
[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 never


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

-rw-r--r--. 1 root root 0 Dec  4 01:01 /var/log/lastlog


pam_lastlog.so_第2张图片




验证nodate:
[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 nodate


pam_lastlog.so_第3张图片




验证noterm:
[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 noterm


pam_lastlog.so_第4张图片




验证nohost:
[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 nohost


pam_lastlog.so_第5张图片




验证inactive(auth):
[root@Zhai ~]# vi /etc/pam.d/sshd

#%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_第6张图片




验证inactive(account):
[root@Zhai ~]# vi /etc/pam.d/sshd

#%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_第7张图片




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


The detailed information:man pam_lastlog