当我尝试在 Windows 机器上的 cygwin sshd 服务器中设置无密码 ssh2 时,在 -vvv 模式下出现以下错误
$ ssh2 -vvv -i .ssh2/id_rsa_2048_b -c aes128-ctr foobar@vm-333-333
2016-08-24 10:19:26: 6200 Broker_tcp_connect, Dst: foobar@vm-333-333, Dst Port: 22, Src Port: -, Local username: toobar
2016-08-24 10:19:26: 1002 Algorithm_negotiation_success, "kex_algorithm=diffie-hellman-group14-sha1, hostkey_algorithm=ssh-rsa, cipher=aes128-ctr/aes128-ctr, mac=hmac-sha1/hmac-sha1, compression=none/none", Session-Id: 6
2016-08-24 10:19:26: 6204 Broker_transport_connect, Dst: foobar@vm-333-333, Dst Port: 22, Remote username: root, Src Port: 43109, Local username: toobar, Session-Id: 6
2016-08-24 10:19:26: 1003 KEX_success, Algorithm: diffie-hellman-group14-sha1, Modulus: 2048 bits, Session-Id: 6, Protocol-session-Id: C80B284B51046645A99EDD512FD3E52BEF204ABA
2016-08-24 10:19:26: 703 Auth_methods_available, Auth methods: publickey,keyboard-interactive, Session-Id: 6
2016-08-24 10:19:26: 6303 Broker_userauth_method_failure, "publickey", Session-Id: 6
2016-08-24 10:19:26: 6209 Broker_connection_connect_failed, Dst: foobar@vm-333-333, Dst Port: 22, Local username: toobar, Remote username: foobar, Uses gateway?: No, Session-Id: 6, "Protocol error, Too many authentication failures, remote disconnect"
Connection open failed; Protocol error (remote): Too many authentication failures
在阅读“身份验证失败次数过多”后,我决定将以下几行添加到我的 sshd_config 文件中,然后重新启动它,但无济于事
MaxAuthTries 30
RSAAuthentication yes
PubKeyAuthentication yes
我将 .ssh2/id_rsa_2048_b.pub 文件导入授权密钥和 authroized_keys2,密钥上的所有权限似乎都设置正确。输入密码后,连接即可正常工作。我不确定如何继续。