How to make eclipse remember ssh key passphrase?
Asked Answered
G

2

8

I'm using Egit with Eclipse to use git and access github. Everything is working fine but one thing that I wish to omit to type id_rsa key passphrase everytime I push my commit to github.

I'm asked to enter passphrase each time I restart Eclipse and try to push.

Passphrase Request

How can I make eclipse remember passphrase so that I don't have to type manually?

Thanks

Grapher answered 29/4, 2013 at 13:56 Comment(3)
You could generate a SSH key which does not have a passphrase if all else fails!Penrose
Yes, it's a way but its not a secure option. is it?Grapher
To be fair, if you are worried about security, you should be prepared to put up with the minor extra step of entering your password.Penrose
B
6

Even if ssh-add -l lists your passphrase-protected key, EGit may not honour it and still ask for passphrase.

To integrate with OS keyring on Ubuntu or Mac OS X put

export GIT_SSH=/usr/bin/ssh

to your ~/.bash_aliases or whenever applicable for your OS.

Balch answered 23/6, 2013 at 21:45 Comment(0)
M
0

Use the ssh agent.

Add your key to the agent with ssh-add. (This will ask you for your passphrase.)

Afterwards the agent should do all the authentication. (No passphrase needed anymore.)

Details:

  • try to access your repository manually: cd $your_repository; git fetch -> it should ask for your passphrase
  • enter ssh-add -l -> it should output "The agent has no identities."
  • enter ssh-add -> it should ask you for your passphrase
  • enter ssh-add -l -> it should list one identity (the key you just added)
  • try to access your repository again: cd $your_repository; git fetch -> it should now work without asking for your passphrase
  • try to access your repository from eclipse. -> again, no passphrase should be needed.
Macule answered 29/4, 2013 at 15:13 Comment(3)
Thanks but still I can't figure out how to do it. Can you explain in little more detail?Grapher
git fetch didn't ask for my passphrase may be because I've set up to remember passphrase when I'm logged into my ubuntu system. Also ssh-add -l shows the key that is added. The problem is only when pushing from Eclipse.Grapher
In that case you should raise a bug against egit. (But check first for possible egit options in eclipse.)Macule

© 2022 - 2024 — McMap. All rights reserved.