每次在Windows上使用Git Bash时,如何防止密码解密私钥? [英] How to prevent that the password to decrypt the private key has to be entered every time when using Git Bash on Windows?
问题描述
我有一个自动构建服务,从git私有仓库下载。
问题是,当它试图克隆仓库时,它需要提供密码,因为它不被记住;因为没有人际交互,所以它永远等待密码。
如何从id_rsa.pub强制记住它?
对于Windows用户,只需注意这一点我是如何在启动时设置Git Bash环境,让我一次登录 。我编辑我的〜/ .bashrc:
eval`ssh-agent`
ssh-add
所以当我启动Git Bash时,它看起来像:
欢迎来到Git(版本1.7.8-preview20111206)
(etc)
代理程序pid 3376
为/c/Users/starmonkey/.ssh/id_dsa输入密码:
添加的身份:/ c / Users / starmonkey / .ssh / id_dsa(/c/Users/starmonkey/.ssh/id_dsa)
现在我可以使用ssh到其他服务器没有每次登录。
我知道这是一个老问题,但我今天从谷歌搜索来到这里,所以我希望这对其他人有帮助。
I've an automatic building service which download from a git private repository. The problem is that when it tries to clone repository it need to provide the password, because it is not remembered; so because there is no human interaction, it waits forever the password. How can I force it to remember from id_rsa.pub?
For Windows users, just a note that this is how I setup the Git Bash environment to log me in once when I start it up. I edit my ~/.bashrc:
eval `ssh-agent` ssh-add
So when I start Git Bash, it looks like:
Welcome to Git (version 1.7.8-preview20111206) (etc) Agent pid 3376 Enter passphrase for /c/Users/starmonkey/.ssh/id_dsa: Identity added: /c/Users/starmonkey/.ssh/id_dsa (/c/Users/starmonkey/.ssh/id_dsa)
And now I can ssh to other servers without logging in every time.
I know this is an old question but I came here today from a google search, so I hope this is helpful to others.
这篇关于每次在Windows上使用Git Bash时,如何防止密码解密私钥?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!