2010-10-12

Using SSH private keys with git and IntelliJ's "IDEA ssh" on Windows

Due to an unfortunate incident with my Linux laptop, I'm stuck working on my Windows gaming rig for a while. That is, of course, an adventure in itself; tonight's adventure was to get private SSH keys working on Windows when using IntelliJ's Git integration.

First step, of course, was to try Pageant. No dice. Then I tried choosing "native ssh" - that just made IntelliJ hang (with no way to cancel - really nice GUI there, guys).

Then the shoe dropped; maybe it pretends to be a "real" ssh client? One short check of my Windows home directory later I'd dropped my id_rsa private key file in %USERPROFILE%/.ssh, and IntelliJ happily picked it up.

5 comments:

Nate said...

I also found it useful to add HOME=%USERPROFILE% to the environment.

DM said...

Great tip, thanks! I generated my key with PuttyGen.exe and exported to OpenSSH format. Then copied it to %USERPROFILE%/.ssh/id_rsa

Ludo said...

You saved my day here. Thanks! Naming the file as id_rsa seems to be the final trick.

Rodislav said...

Many thanks! I have same situation as you.. hope I'll get back to linux soon

Marcus K. said...

Update: With IDEA 15 and Windows 7 the native SSH works fine, even together with Pageant.