新买了腾讯云服务,当使用 SSH 登录云服务器时发现登不上去。服务器版本是centos7.6.用了xshell和putty都不行。
putty提示Disconnected:No supported authentication methods available。
xshell登录时显示只能选择秘钥登录。
查看 /etc/ssh/sshd_config 文件发现
PasswordAuthentication no 说明,ssh协议禁止了密码登录,此处改为yes即可。
PasswordAuthentication yes
然后重启ssh服务
systemctl restart sshd
登录成功。