9

I'm an Eclipse user who's evaluating a switch to IntelliJ IDEA. I'm currently trying out IDEA 10.0.2. My operating system is Windows.

When working with Git over SSH, IDEA always asks me for password. I can't find any option in the settings to make it use public key authentication. As per this post, my key is in the %USERPROFILE%\.ssh directory and my HOME variable points to the same directory as USERPROFILE.

I don't know what I'm doing wrong and Googling for more details hasn't produced any results. Does anyone have any idea how to make IDEA use public key authentication?

EDIT: My key is password-protected.

Vojislav Stojkovic
  • 8,043
  • 4
  • 35
  • 48

2 Answers2

19

If your command line git uses public key auth, the same should work from IDEA. In the IDEA VCS settings switch SSH implementation from IDEA ssh to native so that the same SSH is used as when running command line git.

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
  • 1
    I just tried that, but it doesn't work. My key is password-protected and it seems that IDEA launches git in a windowless process, where it stops, asks for password and waits forever. – Vojislav Stojkovic Apr 01 '11 at 21:21
  • In this case you should configure your git to use TortoisePlink.exe as the ssh client, it will pop up a window asking for the password. Or you can use a key without password protection. – CrazyCoder Apr 01 '11 at 21:47
  • Thanks, that worked! For reference, to make that happen, I had to look at the following question: http://stackoverflow.com/questions/2985074/how-do-i-set-git-to-use-plink-exe – Vojislav Stojkovic Apr 01 '11 at 22:41
  • One caveat I had to figure out (in connection with the SSH: "native", is that the msysgit install does store it's keys in a local \.ssh directory. so keys stores in $HOME\.ssh where not picked up. – Kaj Kandler Oct 01 '14 at 14:14
  • i switched the ssh, but still IDEA doesn't ask me a passphrase! It just freezes after pull or push – voipp Feb 25 '16 at 13:10
  • [Relevant stuff](http://askubuntu.com/a/362287/69674); using `ssh-add` we can suppress git asking for the passphrase so that IDEA can access the repository without any problems. – Raphael Dec 15 '16 at 15:53
4

In the latest version [as of April 29th, 2019], there is no option for SSH executable to switch SSH implementation. So, I followed the following steps on Windows 10:

  1. Create an ssh-keypair (it can be created on Linux and copied onto windows machine)
  2. Copy public SSH key contents to GitHub Settings -> SSH and GPG keys -> New SSH key
  3. Copy private key to C:\Users\<your-user-name>\.ssh\
Junaid
  • 3,477
  • 1
  • 24
  • 24