默认参数安装镜像时会提示输入密码,此时脚本会在安装后的系统的/etc/ssh/sshd_config.d/目录上安装01-PasswordAuthentication.conf和 01-permitrootlogin.conf,修改了原始镜像内容,导致在/etc/ssh/sshd_config中PasswordAuthentication no失效,已经有两台vps被ssh爆破后才发现这个问题。
如何解决:
不要在/etc/ssh/sshd_config修改任何用户配置,而在/etc/ssh/sshd_config.d/中修改。
同步单文件在/etc/ssh/sshd_config的习惯要改正了
评论 (0)