Eclipse:如何使用密钥文件通过 ssh 克隆 git?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4609052/
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
Eclipse: How to clone git over ssh with keyfile?
提问by user562529
Hey, I am using Eclipse (while running Ubuntu 10.10) and would like to connect to a remote git. Normally I would use the egit plugin, but now I need to connect over ssh with keyfile.
嘿,我正在使用 Eclipse(同时运行 Ubuntu 10.10)并且想连接到远程 git。通常我会使用 egit 插件,但现在我需要使用 keyfile 通过 ssh进行连接。
Unfortunately egit has no "with keyfile" option, is there a way to connect to my repository with my keyfile? Is there a "hidden" way to make Eclipse to pass parameters (-i keyfile) to ssh or something?
不幸的是,egit 没有“使用密钥文件”选项,有没有办法用我的密钥文件连接到我的存储库?是否有一种“隐藏”的方式让 Eclipse 将参数(-i 密钥文件)传递给 ssh 或其他东西?
采纳答案by Jayen
http://wiki.eclipse.org/EGit/User_Guide/Remote- I had to manually load my existing key in the "Key Management" tab.
http://wiki.eclipse.org/EGit/User_Guide/Remote- 我必须在“密钥管理”选项卡中手动加载我现有的密钥。
回答by Herr K
I don't know anything about egit. But what you usually do is:
我对 egit 一无所知。但你通常做的是:
Start ssh-agent (mine is automatically started, when my window manager starts, so you have to google a bit how to setup it)
Run ssh-add [your key]
- Use git over ssh as usual. It won't ask you for any passwords, since ssh-agent takes care of it.
启动 ssh-agent(我的是自动启动的,当我的窗口管理器启动时,所以你必须谷歌一下如何设置它)
运行 ssh-add [你的密钥]
- 像往常一样在 ssh 上使用 git。它不会要求您提供任何密码,因为 ssh-agent 会处理它。
HTH
HTH