服务器(Ubuntu):
~/.ssh/authorized_keys文件(在issue-user ):
本地计算机(Windows 7):
git用户一起工作 issue-user不起作用 运行ssh [email protected] -vvv :
debug2: key: /c/***/***/.ssh/identity (0x0) debug2: key: /c/***/***/.ssh/id_rsa (0x0) debug2: key: /c/***/***/.ssh/id_dsa (0x0) debug1: Authentications that can continue: publickey,password debug3: start over, passed a different list publickey,password debug3: preferred publickey,keyboard-interactive,password debug3: authmethod_lookup publickey debug3: remaining preferred: keyboard-interactive,password debug3: authmethod_is_enabled publickey debug1: Next authentication method: publickey debug1: Trying private key: /c/***/***/.ssh/identity debug3: no such identity: /c/***/***/.ssh/identity debug1: Trying private key: /c/***/***/.ssh/id_rsa debug1: read PEM private key done: type RSA debug3: sign_and_send_pubkey debug2: we sent a publickey packet, wait for reply debug1: Authentications that can continue: publickey,password debug1: Trying private key: /c/***/***/.ssh/id_dsa debug3: no such identity: /c/***/***/.ssh/id_dsa debug2: we did not send a packet, disable method debug3: authmethod_lookup password debug3: remaining preferred: ,password debug3: authmethod_is_enabled password debug1: Next authentication method: password
id_rsa密钥文件绝对存在:/ /c/***/***/.ssh/id_rsa
上述两个用户的密钥,父目录和/或主目录的权限存在问题。 我的服务器(Gentoo)明确禁止公开可读的密钥。
家里的权限应该是o-rwx,在.ssh目录下,保存密钥的权限应该是0700,而密钥文件中的authorized_keys权限应该是0640。
SSHD会将这样的问题logging到auth.log中(取决于您的系统日志configuration)。