ssh-agent doesn't work / save me from typing passphrase for git

徘徊边缘 提交于 2019-12-10 11:47:32

问题


After running

eval `ssh-agent -s`
ssh-add ~/.ssh/id_rsa

and entering my passphrase, git still prompts me to enter the passphrase every time I perform a remote action.

To illustrate:

bash-4.1$ echo $SSH_AUTH_SOCK
/tmp/ssh-cWNDloIzZkhW/agent.5560
bash-4.1$ ssh-add -l
2048 <fingerprint> /cygdrive/c/Users/<username>/.ssh/id_rsa (RSA)
bash-4.1$ git pull
Enter passphrase for key '/cygdrive/c/Users/<username>/.ssh/id_rsa':

回答1:


The problem turns out to be that git was using cygwin's ssh, which looks at a different /tmp than git does. I previously renamed the ssh under /git/bin since I thought it caused issues. Renaming it back made everything work.



来源:https://stackoverflow.com/questions/21547242/ssh-agent-doesnt-work-save-me-from-typing-passphrase-for-git

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!