Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse: How to clone git over ssh with keyfile?

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.

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?

like image 689
user562529 Avatar asked Jan 05 '11 20:01

user562529


People also ask

How do I clone a repository using SSH key?

Launch the SSH agent, run the “$ ssh-add ~/. ssh/id_rsa”, add the SSH public key into the agent, and copy it. Next, go to the “GitHub” settings, and add the SSH key. Lastly, open the repository, copy “SSH URL” and execute the “$ git clone” command with copied URL.

How do I clone a Git repository remotely?

To clone a Git repository, you will first copy the remote URL from your repository hosting service—in this case GitHub. You will then use the Git clone command followed by the remote repo's URL. If you are working with a private repository, you will be prompted for your remote hosting service credentials.


2 Answers

http://wiki.eclipse.org/EGit/User_Guide/Remote - I had to manually load my existing key in the "Key Management" tab.

like image 99
Jayen Avatar answered Sep 23 '22 16:09

Jayen


I don't know anything about egit. But what you usually do is:

  1. Start ssh-agent (mine is automatically started, when my window manager starts, so you have to google a bit how to setup it)

  2. Run ssh-add [your key]

  3. Use git over ssh as usual. It won't ask you for any passwords, since ssh-agent takes care of it.

HTH

like image 40
Herr K Avatar answered Sep 22 '22 16:09

Herr K