Git不断向我询问我的ssh密钥密码 [英] Git keeps asking me for my ssh key passphrase
问题描述
我正在使用Linux,并且按照github教程中的说明创建了密钥,并使用github注册了这些密钥,并且明确尝试了使用ssh-agent - 但是,每次我尝试执行pull操作时,git都会继续询问我的密码。一次推。
可能是什么原因?
您已经开始使用SSH代理:
eval $(ssh-agent)
- b
您必须将您的私钥添加到它:
ssh-add
这会询问您的密码只需要一次,然后你应该被允许推送,只要你将公钥上传到Github即可。
$ bssh-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)
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.
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屋!