Wrong password three times in a row centos set to lock automatically login account three minutes

root #% PAM-1.0 at /etc/pam.d/sshd added under line of file:

#%PAM-1.0
auth       required     pam_tally2.so deny=3 unlock_time=180
auth       required     pam_sepermit.so
auth       include      password-auth
account    required     pam_nologin.so
account    include      password-auth
password   include      password-auth
# pam_selinux.so close should be the first session rule
session    required     pam_selinux.so close
session    required     pam_loginuid.so
# pam_selinux.so open should only be followed by sessions to be executed in the user context
session    required     pam_selinux.so open env_params
session    required     pam_namespace.so
session    optional     pam_keyinit.so force revoke
session    include      password-auth

Explained:
deny setting the average user and root user landing the maximum number of consecutive errors exceeds the maximum number, then the user is locked;
unlock_time set the average user to lock, unlock after how much time, in seconds;

reference:

1、(https://blog.csdn.net/weixin_34117522/article/details/91664010)

2、(https://blog.csdn.net/weixin_43822878/article/details/93018223)

3、(https://wenku.baidu.com/view/411ba45a4b73f242336c5fdd.html)

Guess you like

Origin www.cnblogs.com/jszd/p/11491905.html