Git ssh 私钥密码
我试图在 Windows 中从命令提示符调用 git fetch,唯一的问题是它要求输入私钥的密码。我有它,但是是否可以像在 git fetch 的参数中提供它一样自动提供?我知道 ssh 代理仅在您打开终端时要求输入密码一次,但这对我来说不是一个解决方案,因为我希望该过程在没有用户交互的情况下自动进行,最好的解决方案是我可以将其作为参数给出。谢谢。
编辑:谢谢您的回答。我想要完成的是在 Titanium Developer 中构建一个简单的 git 通知程序。为此,我想支持所有身份验证方法,包括带密码的 ssh。例如,在 smartgit 客户端中,您可以为每个项目提供私钥和密码(如果有),然后您可以使用可用的 git 命令。我想知道是否可以从控制台自动输入密码,因为这将是最简单的方法,但我想我将不得不使用 java 或 C。
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.
EDIT: 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信实现您正在寻找的功能的唯一方法是使用某种自动打字功能。我在有关 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.