Eclipse - Use EGit to push project with ssh key

2015-10-08 3:32 PM
Go to Window -> Preference -> General -> Network Connections -> SSH2

You'll see a tab named "General".

And the default value of "SSH2 home" will be "C:\User\user\.ssh"

The default value of "Private keys" will be "id_rsa" or "id_dsa" (or empty if you never generated one ).

Then go to Key Management tab page and choose what kind of algorithm you want to use, DSA key or RSA key ( bitbucket and github are both using RSA ).

And you can see the public key in the textarea after you click the Generate Key button

Paste thie public key to the key management page on Bitbucket or Github.

Back to Eclipse and click "Save Private Key" to save your key into SSH2 home directory.

Then click "Export Via SFTP" and input your Known hosts ( or ).

Click "OK" to save and close the SSH2 settings window.

If you wanna make sure if it's saved correctly, you can reopen this SSH2 settings

and navigate to "Key Management" tab page and click "Load Existing Key" and load the key you just created.

Then you can see your known hosts in "Known Hosts" tab page.

Due to the caching problem you should restart Eclipse after you changed these settings.

Or you may get some certification problems.

And now you can push your project to Bitbucket or Github with ssh key.

No comments:

Post a Comment