我已经使用无密码登录ssh
至少两年了,但我已经很久没有因为ssh
任何原因需要登录我的笔记本电脑了。所以当我发现它不再有效时,我感到很震惊!
我的公钥 ( id_rsa.pub
) 仍像它应该的那样在我的authorized_keys
文件中,但不知何故,我的系统不再接受它。此外,当我使用 创建新密钥并将ssh-keygen
其添加到时authorized keys
,新密钥也不起作用。我的文件夹中的所有文件.ssh
都有600
权限,.ssh
文件夹本身也有700
权限。
有人知道为什么会发生这种情况吗?我正在运行 macOS Sierra (10.12.2)。
下面是一些调试输出,为了简洁起见,略作了编辑:
09:38 [mchenja .ssh]$ diff -s id_rsa.pub authorized_keys
Files id_rsa.pub and authorized_keys are identical
09:39 [mchenja .ssh]$ ssh -v localhost
.
.
.
debug1: Host 'localhost' is known and matches the ECDSA host key.
debug1: Found key in /Users/mchenja/.ssh/known_hosts:2
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/mchenja/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Trying private key: /Users/mchenja/.ssh/id_dsa
debug1: Trying private key: /Users/mchenja/.ssh/id_ecdsa
debug1: Trying private key: /Users/mchenja/.ssh/id_ed25519
debug1: Next authentication method: keyboard-interactive
Password: