![sftp 连接进行了过多次公钥验证尝试错误](https://linux22.com/image/1516212/sftp%20%E8%BF%9E%E6%8E%A5%E8%BF%9B%E8%A1%8C%E4%BA%86%E8%BF%87%E5%A4%9A%E6%AC%A1%E5%85%AC%E9%92%A5%E9%AA%8C%E8%AF%81%E5%B0%9D%E8%AF%95%E9%94%99%E8%AF%AF.png)
我正在尝试建立 sftp 连接。目标使用公钥 + 密码验证和端口 2222。
我能够从我们现有的 Linux 主机连接到目标。我们现有的 Linux 主机使用 Openssh_5.3。
sftp -v -oPort=2222 -oIdentityFile=/home/xyz/.ssh/abc/id_rsa [email protected]
debug1: Authentications that can continue: password,publickey,keyboard-interactive
debug1: Offering public key: /home/xyz/.ssh/abc/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: read PEM private key done: type RSA
Authenticated with partial success.
debug1: Authentications that can continue: password,publickey,keyboard-interactive
debug1: Offering public key ...
...
debug1: Next authentication method: keyboard-interactive
Here it goes to the next authentication method keyboard-interactive with no problem.
我无法从我们的下一个 Linux 主机进行连接。它使用 OpenSSH_6.6.1。我们的新 Linux 主机具有相同的出站 IP,并且目标未按 IP 地址过滤连接。我使用完全相同的私钥文件和 sftp 命令。所以这看起来像是 ssh 问题?
我得到的错误是:
sftp -v -oPort=2222 -oIdentityFile=/home/xyz/.ssh/abc/id_rsa [email protected]
debug1: Authentications that can continue: password,publickey,keyboard-interactive
debug1: Offering RSA public key: /home/xyz/.ssh/abc/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: key_parse_private2: missing begin marker
debug1: read PEM private key done: type RSA
Authenticated with partial success.
debug1: Authentications that can continue: password,publickey,keyboard-interactive
debug1: Offering RSA public key: ....
......
debug1: Authentications that can continue: password,publickey,keyboard-interactive
debug1: Offering RSA public key: /home/xyz/.ssh/abc/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: key_parse_private2: missing begin marker
debug1: read PEM private key done: type RSA
Authenticated with partial success.
debug1: Authentications that can continue: password,publickey,keyboard-interactive
debug1: Offering RSA public key: ....
......
Here it goes as infinite loop and keep trying the same private key again and again (although it already got partial success)
until it got "**Too many publickey verification attempts were made**" error.
如果我使用 -vvv 运行,则输出如下:
debug1: Authentications that can continue: password,publickey,keyboard-interactive
debug1: Trying private key: /home/xyz/.ssh/abc/id_rsa
debug1: key_parse_private2: missing begin marker
debug1: read PEM private key done: type RSA
debug3: sign_and_send_pubkey: RSA 7f:69:c6:c9:be:54:6e:7a:35:7d:63:b6:7f:28:0f:20
debug2: we sent a publickey packet, wait for reply
Authenticated with partial success.
debug2: key: /home/xyz/.ssh/abc/id_rsa ((nil)), explicit
debug2: key: /home/xyz/.ssh/id_rsa ((nil)),
debug2: key: /home/xyz/.ssh/id_dsa ((nil)),
debug1: Authentications that can continue: password,publickey,keyboard-interactive
debug1: Trying private key: /home/xyz/.ssh/abc/id_rsa
debug1: key_parse_private2: missing begin marker
debug1: read PEM private key done: type RSA
debug3: sign_and_send_pubkey: RSA 7f:69:c6:c9:be:54:6e:7a:35:7d:63:b6:7f:28:0f:20
debug2: we sent a publickey packet, wait for reply
Authenticated with partial success.
debug2: key: /home/xyz/.ssh/abc/id_rsa ((nil)), explicit
debug2: key: /home/xyz/.ssh/id_rsa ((nil)),
debug2: key: /home/xyz/.ssh/id_dsa ((nil)),
debug1: Authentications that can continue: password,publickey,keyboard-interactive
debug1: Trying private key: /home/xyz/.ssh/abc/id_rsa
debug1: key_parse_private2: missing begin marker
debug1: read PEM private key done: type RSA
debug3: sign_and_send_pubkey: RSA 7f:69:c6:c9:be:54:6e:7a:35:7d:63:b6:7f:28:0f:20
debug2: we sent a publickey packet, wait for reply
Authenticated with partial success.
debug2: key: /home/xyz/.ssh/abc/id_rsa ((nil)), explicit
debug2: key: /home/xyz/.ssh/id_rsa ((nil)),
debug2: key: /home/xyz/.ssh/id_dsa ((nil)),
debug1: Authentications that can continue: password,publickey,keyboard-interactive
debug1: Trying private key: /home/xyz/.ssh/abc/id_rsa
debug1: key_parse_private2: missing begin marker
debug1: read PEM private key done: type RSA
debug3: sign_and_send_pubkey: RSA 7f:69:c6:c9:be:54:6e:7a:35:7d:63:b6:7f:28:0f:20
debug2: we sent a publickey packet, wait for reply
This goes on again and again, so I just killed it.