Git ssh 私钥密码 [英] Git ssh private key passphrase

查看:38
本文介绍了Git ssh 私钥密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图从 Windows 中的命令提示符调用 git fetch,唯一的问题是它要求输入私钥的密码.我有它,但是是否可以像在 git fetch 的参数中一样自动提供它?我知道 ssh 代理在您打开终端时只要求输入一次密码,但这对我来说不是一个解决方案,因为我希望该过程在没有用户交互的情况下自动进行,最好的解决方案是我可以将其作为参数.谢谢.

I am trying to call git fetch from command prompt in windows, the only problem is that it asks for the passphrase of the private key. I have it, but is it possible to be supplied automatically like giving it in an argument to git fetch? I know ssh agent asks for the password only once when you open the terminal, but that is not a solution for me as i want the process to be automatic without user interaction, the best solution would be if i can give it as an argument. Thank you.

感谢您的回答.我试图完成的是在 Titanium Developer 中构建一个简单的 git 通知程序.为此,我想支持所有身份验证方法,包括带密码的 ssh.例如,在 smartgit 客户端中,您可以为每个项目提供私钥和密码(如果有的话),然后您就可以使用可用的 git 命令.我想知道是否可以从控制台自动输入密码,因为这是最简单的方法,但我想我将不得不使用 java 或 C.

Thank you for your answers. What i was trying to accomplish is to build a simple git notifier in Titanium Developer. For that i wanted to support all authentication methods including ssh with passphrase. In smartgit client for example you can supply the private key and the passphrase(if you have one) for each project, then you can use the available git commands. I wanted to know if it is possible to enter the passhprase automatically from the console as that would have been the easiest way to do this, but i guess i will have to go with java or C.

推荐答案

我相信实现您所需要的唯一方法是使用某种自动键入功能.我在讨论 SSH 和没有密码或密码的情况下登录时看到了一些提到.使用它们的普遍共识是不要".他们非常不安全.您也许应该从私钥中删除密码如果您不希望它是必需的.

I believe the only way to do what you're looking for is with some kind of auto-typing feature. I've seen a few mentioned in discussions of SSH and logging in without a password or passphrase. The general consensus on using them is "don't". They're incredibly unsecure. You should maybe just remove the passphrase from the private key if you don't want it to be required.

这篇关于Git ssh 私钥密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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