如何设置 ssh 密钥以绕过 git bash 密码提示
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10311437/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to setup ssh key to bypass git bash password prompt
提问by Itay Grudev
I would like to disable the password prompt of git, so I thought that I can setup a ssh-key onto my remote repository. But how do I associate it with git on my computer.
我想禁用 git 的密码提示,所以我想我可以在我的远程存储库上设置一个 ssh-key。但是我如何将它与我计算机上的 git 相关联。
Thanks.
谢谢。
回答by VonC
It should only ask for a password if you access git through SSH using a password-protected private key.
If that is the case, you need to run an SSH agent, as described in "Remember Password, Git bash under windows".
如果您使用受密码保护的私钥通过 SSH 访问 git,它应该只要求输入密码。
如果是这种情况,您需要运行 SSH 代理,如“记住密码,Windows 下的 Git bash”中所述。
回答by Rick-Rainer Ludwig
You should have a look to gitolite: http://sitaramc.github.com/gitolite. There is everything in you need and also explained how to setup. A password less login is also possible for CI server for example.
你应该看看 gitolite:http://sitaramc.github.com/gitolite 。有你需要的一切,还解释了如何设置。例如,CI 服务器也可以使用无密码登录。
My experience tells me not to use something else, because a self made solution is too cumbersome.
我的经验告诉我不要使用其他的东西,因为一个自制的解决方案太麻烦了。
回答by GoZoner
Very detailed instructions can be found on the GitHub website at Win-Set-Up-Git. GitHub has an interest in making sure those instructions are good; if they are not, let them know as they will want to improve them.
可以在 GitHub 网站的Win-Set-Up-Git上找到非常详细的说明。GitHub 有兴趣确保这些说明是好的;如果不是,让他们知道,因为他们会想要改进它们。
回答by Praveen Thakur
You can use "start-ssh-agent.cmd" on windows which will use ssh key to authenticate. This can be found in "GIT/cmd" directory.
您可以在使用 ssh 密钥进行身份验证的 Windows 上使用“start-ssh-agent.cmd”。这可以在“GIT/cmd”目录中找到。