如何防止每次在 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?

查看:40
本文介绍了如何防止每次在 Windows 上使用 Git Bash 时都必须输入解密私钥的密码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个从 git 私有存储库下载的自动构建服务.问题是当它试图克隆存储库时,它需要提供密码,因为它不会被记住;所以因为没有人工交互,所以它永远等待密码.如何强制它从 id_rsa.pub 中记住?

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?

推荐答案

对于 Windows 用户,请注意,这是我设置 Git Bash 环境以在我开始时登录一次的方式它了.我编辑我的 ~/.bashrc 文件:

For Windows users, just a note that this is how I set up the Git Bash environment to log me in once when I start it up. I edit my ~/.bashrc file:

eval `ssh-agent`
ssh-add

所以当我启动 Git Bash 时,它看起来像:

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)

现在我可以 ssh 到其他服务器,而无需每次都登录.

And now I can ssh to other servers without logging in every time.

这篇关于如何防止每次在 Windows 上使用 Git Bash 时都必须输入解密私钥的密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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