日期:2026-06-16
3223/etc/ssh/sshd_config修改内容:
- #Port 22
+ Port 3223
- PasswordAuthentication yes
+ PasswordAuthentication no
/etc/ssh/sshd_config.d/50-cloud-init.conf该 Include 文件中存在密码登录配置,为避免覆盖主配置,同步修改:
- PasswordAuthentication yes
+ PasswordAuthentication no
执行:
sshd -t
结果:无输出,表示配置语法校验通过。
执行其一:
systemctl reload ssh
或:
systemctl reload sshd