ssh-key-auth-flow.jpg今天在UCloud的香港主机调试环境的时候使用XShell登录时突然被要求提供密钥,然后我并没有生成过密钥,谷歌了一下,通过后台终端登录取消了密钥登录,具体如下:
- 修改配置文件
vim /etc/ssh/sshd_config
- 去掉
PermitRootLogin yes
前面的 #注释 - 修改
PasswordAuthentication no
为PasswordAuthentication yes
- 重启 ssh 服务或重启服务器
service sshd restart
或者systemctl restart sshd.service