无法使用密码 ssh 登录 - 未提供提示 - 身份验证失败次数过多

无法使用密码 ssh 登录 - 未提供提示 - 身份验证失败次数过多

我正在尝试在 Raspberry Pi 上登录全新安装的 openSUSE Leap 42.2。该设置完全默认,并且 pi 上没有存储公钥。

当我尝试通过登录时出现错误:ssh [email protected]

Received disconnect from 192.168.1.56 port 22:2: Too many authentication failures
Connection to 192.168.1.56 closed by remote host.
Connection to 192.168.1.56 closed.

使用ssh -v表明正在提供大量公钥:

debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/robert/.ssh/id_rsa
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Offering DSA public key: /home/robert/.ssh/id_dsa
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Offering RSA public key: robert@XXX
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Offering RSA public key: robert@yyy
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Offering RSA public key: robert@zzz
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Offering RSA public key: backup-login@xxx

我认为每次身份验证尝试都会计数并导致服务器停止与我通信。

果然,当我从不同的用户帐户登录时,出现密码提示。

在服务器上出现以下错误消息

Dec 09 20:27:18 linux sshd[1020]: error: maximum authentication attempts exceeded for root from 192.168.1.52 port 35088 ssh2 [preauth]

要解决此问题,请尝试强制进行密码身份验证,如下所述如何强制 ssh 客户端仅使用密码身份验证?

ssh  -o PreferredAuthentications=password -o PubkeyAuthentication=no [email protected]

现在导致

Permission denied (publickey,keyboard-interactive).

在这种情况下如何才能使用基于密码的登录?

答案1

“密码”和“键盘交互”是两种不同的身份验证类型;楼主提供的是后者。因此,您需要在首选身份验证列表中使用它:

ssh -o PreferredAuthentications=keyboard-interactive …

相关内容