我怎么能得到sshd告诉我为什么它是公钥authentication失败?

我使用OpenSSH 6.9p1(在Lubuntu上)作为我的SSH服务器。 当试图连接到它时(使用Cygwin中的SSH客户端),尽pipe已经正确生成了我的密钥,将它们放在服务器上的授权密钥文件中,检查了权限等信息,但仍然不断被恢复为密码身份validation。

所以,我查看/var/log/auth.log查看服务器说什么。 我觉得这个:

 Nov 1 09:50:10 er-thinkpad sshd[16148]: Accepted password for joeuser from 192.168.2.6 port 53325 ssh2 Nov 1 09:50:10 er-thinkpad sshd[16148]: pam_unix(sshd:session): session opened for user joeuser by (uid=0) Nov 1 09:50:10 er-thinkpad systemd-logind[590]: New session 497 of user joeuser. 

没有任何关于公钥authentication失败的第一行。 好吧,让我们来增加详细程度吧。 所以我将LogLevelINFO更改为VERBOSE然后重试。 现在我得到:

 Nov 1 09:53:12 er-thinkpad sshd[16269]: Connection from 192.168.2.6 port 53349 on 192.168.2.2 port 22 Nov 1 09:53:12 er-thinkpad sshd[16269]: Failed publickey for joeuser from 192.168.2.6 port 53349 ssh2: RSA SHA256:removedthis Nov 1 09:53:12 er-thinkpad sshd[16269]: Failed publickey for joeuser from 192.168.2.6 port 53349 ssh2: ECDSA SHA256:removedthis Nov 1 09:53:15 er-thinkpad sshd[16269]: Accepted password for joeuser from 192.168.2.6 port 53349 ssh2 Nov 1 09:53:15 er-thinkpad sshd[16269]: pam_unix(sshd:session): session opened for user joeuser by (uid=0) Nov 1 09:53:15 er-thinkpad systemd-logind[590]: New session 499 of user joeuser. Nov 1 09:53:15 er-thinkpad sshd[16269]: User child is on pid 16271 Nov 1 09:53:15 er-thinkpad sshd[16271]: Starting session: shell on pts/5 for joeuser from 192.168.2.6 port 53349 

如此伟大,它失败了,但它为什么失败? 我怎样才能让sshd告诉我呢?


PS – 就这么你知道,这是客户看到的:

 debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,password debug1: Next authentication method: publickey debug1: Offering RSA public key: /home/joeuser/.ssh/id_rsa debug1: Authentications that can continue: publickey,password debug1: Skipping ssh-dss key /home/joeuser/.ssh/id_dsa for not in PubkeyAcceptedKeyTypes debug1: Offering ECDSA public key: /home/joeuser/.ssh/id_ecdsa debug1: Authentications that can continue: publickey,password debug1: Trying private key: /home/joeuser/.ssh/id_ed25519 debug1: Next authentication method: password 

在服务器端,将日志级别设置为DEBUG3 。 在客户端,连接-vvv选项(在客户端也可以使用DEBUG3 )。