Git ssh private key passphrase

烈酒焚心 提交于 2020-01-16 04:21:27

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/7296464/git-ssh-private-key-passphrase

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!