有时,我的邮件服务器会停止发送任何新邮件,而且我每次都会找到错误日志,
Jun 22 23:10:18 myserver saslauthd[3967]: DEBUG: auth_pam: pam_authenticate failed: Memory buffer error
Jun 22 23:10:18 myserver saslauthd[3971]: DEBUG: auth_pam: pam_authenticate failed: Memory buffer error
Jun 22 23:10:19 myserver saslauthd[3972]: DEBUG: auth_pam: pam_authenticate failed: Memory buffer error
Jun 22 23:10:19 myserver saslauthd[3968]: DEBUG: auth_pam: pam_authenticate failed: Memory buffer error
Jun 22 23:10:20 myserver saslauthd[3969]: DEBUG: auth_pam: pam_authenticate failed: Memory buffer error
Jun 22 23:10:20 myserver saslauthd[3967]: DEBUG: auth_pam: pam_authenticate failed: Memory buffer error
Jun 22 23:10:21 myserver saslauthd[3971]: DEBUG: auth_pam: pam_authenticate failed: Memory buffer error
Jun 22 23:10:21 myserver saslauthd[3972]: DEBUG: auth_pam: pam_authenticate failed: Memory buffer error
Jun 22 23:10:22 myserver saslauthd[3971]: DEBUG: auth_pam: pam_authenticate failed: Memory buffer error
每次我必须重新启动我的服务器才能再次正常工作
我也总是从未知 IP 中找到以下重复错误日志(我不确定它是否相关):
Jun 21 06:48:43 myserver sshd[1687]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=************ user=root
Jun 21 06:48:45 myserver sshd[1708]: Failed password for root from ######## port 60021 ssh2
Jun 21 06:48:47 myserver sshd[1708]: Failed password for root from ######## port 60021 ssh2
Jun 21 06:48:47 myserver sshd[1708]: Received disconnect from #######: 11: [preauth]
Jun 21 06:48:47 myserver sshd[1708]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=************ user=root
Jun 21 06:48:47 myserver sshd[1730]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=************ user=root
Jun 21 06:48:48 myserver sshd[1732]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost============= user=root
Jun 21 06:48:48 myserver sshd[1730]: Failed password for root from ************ port 60094 ssh2
Jun 21 06:48:50 myserver sshd[1732]: Failed password for root from ============ port 40613 ssh2
Jun 21 06:48:50 myserver sshd[1730]: Failed password for root from ************ port 60094 ssh2
Jun 21 06:48:50 myserver sshd[1734]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=************ user=root
Jun 21 06:48:52 myserver sshd[1736]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=************ user=root
Jun 21 06:48:52 myserver sshd[1732]: Failed password for root from ============ port 40613 ssh2
Jun 21 06:48:52 myserver sshd[1730]: Failed password for root from ************ port 60094 ssh2
Jun 21 06:48:52 myserver sshd[1730]: Received disconnect from ***********: 11: [preauth]
Jun 21 06:48:52 myserver sshd[1730]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=*********** user=root
Jun 21 06:48:52 myserver sshd[1734]: Failed password for root from ######## port 47803 ssh2
Jun 21 06:48:54 myserver sshd[1736]: Failed password for root from ######## port 55371 ssh2
Jun 21 06:48:54 myserver sshd[1732]: Failed password for root from ============ port 40613 ssh2
根据https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=758660 saslauthd 在一定数量的登录(成功和/或失败)后停止运行。
您不需要重新启动整个服务器,以下内容就足够了:
service saslauthd restart
您可以将其放入 crontab 中。如果大量登录来自同一个恶意 IP,您可以在防火墙中删除来自该 IP 的请求,以使 saslauthd 持续更长时间,例如
iptables -A INPUT -s 185.29.11.6 -j DROP