如何解决导致ssh客户端要求输入密码的原因是可能的身份验证,但在拒绝登录之前未提示用户输入密码?
是什么原因导致ssh客户端声称密码是可能的身份验证,但是在拒绝登录之前没有提示用户输入密码?
例如:
ssh -v test@localhsot
> Authentications that can continue: publickey,password
> Next authentication method: publickey debug1: Trying private key:
> /home/ubuntu/.ssh/id_rsa debug1: Trying private key:
> /home/ubuntu/.ssh/id_dsa debug1: Trying private key:
> /home/ubuntu/.ssh/id_ecdsa debug1: Trying private key:
> /home/ubuntu/.ssh/id_ed25519 debug1: No more authentication methods to
> try.
test @ localhost:权限被拒绝(公钥,密码)。
解决方法
服务器关闭密码身份验证时会发生这种情况
sudo grep -i password /etc/ssh/ssh_config
PasswordAuthentication否 ssh -v test @ localhost ...
> debug1: Authentications that can continue: publickey,password debug1:
> Next authentication method: publickey debug1: Trying private key:
> /home/ubuntu/.ssh/id_rsa debug1: Trying private key:
> /home/ubuntu/.ssh/id_dsa debug1: Trying private key:
> /home/ubuntu/.ssh/id_ecdsa debug1: Trying private key:
> /home/ubuntu/.ssh/id_ed25519 debug1: No more authentication methods to
sudo vi /etc/ssh/ssh_config
sudo grep -i password /etc/ssh/ssh_config
PasswordAuthentication是
enter code here
...
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/ubuntu/.ssh/id_rsa
debug1: Trying private key: /home/ubuntu/.ssh/id_dsa
debug1: Trying private key: /home/ubuntu/.ssh/id_ecdsa
debug1: Trying private key: /home/ubuntu/.ssh/id_ed25519
debug1: Next authentication method: password
test@localhost's password:
debug1: Authentication succeeded (password).
欢迎使用Ubuntu 18.04.5 LTS(GNU / Linux x86_64)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。