Home Articles

无法执行无密码验证ssh

Asked
Viewed 290 times
1

创建一对密钥并通过ssh-copy-id向服务器发送公钥后,我仍然无法登录而无需密码

ssh -v user @ host的输出

  • debug1:找到/home/pumba/.ssh/known_hosts:1中的密钥

  • debug1:在134217728块之后重新生成密钥

  • debug1:发送SSH2_MSG_NEWKEYS

  • debug1:期待SSH2_MSG_NEWKEYS

  • debug1:在134217728块之后重新生成密钥

  • debug1:收到SSH2_MSG_NEWKEYS

  • debug1:收到SSH2_MSG_EXT_INFO

  • debug1:kex_input_ext_info:server-sig-algs =

  • debug1:收到SSH2_MSG_SERVICE_ACCEPT

  • debug1:可以继续的身份验证:publickey,password

  • debug1:下一个身份验证方法:publickey

  • debug1:提供RSA公钥:/home/pumba/.ssh/id_rsa

  • debug1:可以继续的身份验证:publickey,password

  • debug1:尝试私钥:/home/user/.ssh/id_dsa

  • debug1:尝试私钥:/home/pumba/.ssh/id_ecdsa

  • debug1:尝试私钥:/home/pumba/.ssh/id_ed25519

  • debug1:下一个身份验证方法:密码

1 Answer

  • 0

    调试SSH无密码身份验证:

    Run in detailed debug mode -vvv

    ssh -vvv user @ host

    Run with a specific key

    ssh -i public_key user @ host

    Check File Permissions

    〜 . / ssh权限应为700~ . / ssh应归您的帐户所有〜/ .ssh / authorized_keys权限应为600~ / .ssh / authorized_keys应归您的帐户所有

    客户权限:

    /.ssh/config权限应为600〜/ .ssh / id_ *权限应为600

    Check if your private key matches with public key

    Local:ssh-keygen -y -f~ / .ssh / id_rsa服务器:cat~ / .ssh / authorized_keys

Related