Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make IntelliJ IDEA use public key authentication on Windows

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.

like image 522
Vojislav Stojkovic Avatar asked Apr 01 '11 20:04

Vojislav Stojkovic


People also ask

How do I make my SSH key public?

To generate an SSH private/public key pair for your use, you can use the ssh-keygen command-line utility. You can run the ssh-keygen command from the command line to generate an SSH private/public key pair. If you are using Windows, by default you may not have access to the ssh-keygen command.

Where should this key be put to grant remote access using public key authentication method?

You need to be able to transfer your public key to the remote system. Therefore, you must either be able to log into the remote system with an established account username and password/passphrase, or have an administrator on the remote system add the public key to the ~/. ssh/authorized_keys file in your account.


2 Answers

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.

like image 194
CrazyCoder Avatar answered Oct 12 '22 22:10

CrazyCoder


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\
like image 42
Junaid Avatar answered Oct 12 '22 20:10

Junaid