在几次错误的登录尝试之后(使用密码),我的IP会被阻塞,我无法在几分钟内将SSH登录到Ubuntu服务器。
我不希望这种情况发生(至少对我的IP来说是这样)。事实上,我想在我的服务器上白名单我的IP。但我不知道该在哪里做。我有不明飞行物残疾。我不使用fail2ban,也不使用pam_tally或pam_faillock。我已经安装了用于2因素身份验证的libpam-google-authenticator和用于强密码策略的pam_cracklib.so。事实上,我甚至不知道是什么阻碍了我的IP的失败尝试。我的/etc/pam.d中有以下文件
atd
chfn
chpasswd
chsh
common-account
common-auth
common-password
common-session
common-session-noninteractive
cron
login
newusers
other
passwd
polkit-1
runuser
runuser-l
sshd
su
sudo
systemd-user
vmtoolsd有谁能告诉我,我该怎么做才能使我的IP不因身份验证失败而被阻止?
在sshd_config文件中,我设置了MaxAuthTries 20。但ssh在8次错误尝试中失败。也没有什么关于封锁时间或白名单。
上次发生这种情况时,/var/log/auth.log中的最后几个条目如下所示。
Aug 26 15:04:24 Bastion sshd(pam_google_authenticator)[2661]: Did not receive verification code from user
Aug 26 15:04:24 Bastion-ip-10-0-1-45 sshd(pam_google_authenticator)[2661]: Invalid verification code for username
Aug 26 15:04:26 Bastion sshd[2657]: error: PAM: Authentication failure for username from xxx.xxx.xxx.xxx
Aug 26 15:04:27 Bastion sshd(pam_google_authenticator)[3247]: Did not receive verification code from user
Aug 26 15:04:27 Bastion sshd(pam_google_authenticator)[3247]: Invalid verification code for username
Aug 26 15:04:29 Bastion sshd[2657]: error: PAM: Authentication failure for username from xxx.xxx.xxx.xxxXxx.xxx是被封锁的IP。
发布于 2020-09-10 07:41:30
我解决了这个问题。是OSSEC。我在服务器上也安装了一个ossec-hids代理。ossec中的主动响应功能是阻止ssh故障的IP。通过在ossec管理器中的ossec.conf文件中添加全局块1.2.3.4中要忽略的IP来修正该问题。谢谢所有有用的建议伙计们。
https://askubuntu.com/questions/1269998
复制相似问题