Git不断向我询问我的ssh密钥密码 [英] Git keeps asking me for my ssh key passphrase

查看:95
本文介绍了Git不断向我询问我的ssh密钥密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Linux,并且按照github教程中的说明创建了密钥,并使用github注册了这些密钥,并且明确尝试了使用ssh-agent - 但是,每次我尝试执行pull操作时,git都会继续询问我的密码。一次推。



可能是什么原因?

解决方案

您已经开始使用SSH代理:

  eval $(ssh-agent)




  1. 您必须将您的私钥添加到它:

      ssh-add 

    这会询问您的密码只需要一次,然后你应该被允许推送,只要你将公钥上传到Github即可。

  2. b
    $ b

      ssh-add -K 



在关闭并重新打开后,它会保留它。

I'm using Linux and I created keys as instructed in the github tutorial, registered them with github, and tried using ssh-agent explicitly — yet git continues to ask me for my passphrase every time I try to do a pull or a push.

What could be the cause?

解决方案

Once you have started the SSH agent with:

eval $(ssh-agent)

  1. You have to add your private key to it:

    ssh-add
    

    This will ask you your passphrase just once, and then you should be allowed to push, provided that you uploaded the public key to Github.

  2. To save key permanently:

    ssh-add -K  
    

    This will persist it after you close and re-open it by storing it in user's keychain.

这篇关于Git不断向我询问我的ssh密钥密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆