Young_Maker
Young_Maker

Reputation: 293

Egit ssh problems

I have been trying to get gitHub and Egit to cooperate, with no success. I installed github's software bundle and made an SSH key that way, but Egit gives me no prompt for the passphrase, and it gives me this error:

Cannot get remote repository refs.
Reason: ssh://[email protected]:22: passphrase for C:\Documents and Settings\User\.ssh\id_rsa

I have these settings in the push menu:

URI: ssh://[email protected]/YoungMaker/<projectName>.git
host: github.com
Repository path: /YoungMaker/<projectName>.git
protocol: SSH
port <BLANK>
User: git
password <blank>

I also tried the GIT_SSH environment variable, and set it to C:\Documents and Settings\User.ssh, as well as plink.exe (I don't know what that is (clearly some .exe))

After trying to push from the gitHub GUI, I got this error. Its quite strange because I have the C:\Documents and Settings\User.ssh directory with a config file and an id_rsa key in it.

Pushing to [email protected]:YoungMaker/GitTester.git
error: cannot spawn C:\Documents and Settings\User\.ssh: No such file or directory
fatal: unable to fork

Upvotes: 7

Views: 7659

Answers (2)

Mr Baloon
Mr Baloon

Reputation: 2766

Old question, but for future reference:

Make sure you did setup a push remote. It worked for me when I got both the Cannot get remote repository refs-problems ("... Passphrase for..." and "Auth fail" in the "Push..." dialog).

Provided that you already:

  1. Setup your SSH keys with Github (Window > Preferences > General > Network Connections > SSH2)

  2. Setup your local repository (you can follow this guide for that)

  3. Created a Github repository (same guide)

... here's how you do it:

  • Go to the Git Repositories view (Window > Show View > Other > Git Repositories)
  • Expand your Repository and right click Remotes --> "Create Remote"
  • "Remote Name": origin, "Configure push": checked --> click "OK"
  • Click the "Change..." button
  • Paste your git URI and select protocol ssh --> click "Finish"
  • Now, click "Save and Push" and NOW you should get a password prompt --> enter the public key passphrase here (provided that you DID (and you should) setup a passphrase to your public key) --> click "OK"
  • Now you should get a confirmation window saying "Pushed to YourRepository - origin" --> click "OK"
  • Push to upstream, but this time use "Configured remote repository" as your Destination Git repository
  • Go get yourself a well earned cup of coffee!

Upvotes: 6

VonC
VonC

Reputation: 1323243

The passphrase is needed if you created a private key protected by one, as described in "GitHub: SSH key passphrase".
But that means you need an SSH agent to provide that passphrase for you.

If Egit doesn't prompt for one when pushing, that could mean:

  • your SSH key wasn't protected by a passphrase
  • your SSH key isn't somehow accessible (wrong path, or wrong protection on that path)

See also Vogella's tutorial:

Egit ssh uri

Upvotes: 2

Related Questions