How to connect to server using a private key

As the title indicates, I am trying to connect to two remote servers from PHPStorm 3.0.3 using my new private key (SSH-DSA 2048 bit). However, I get errors. I had been able to connect to the SVN repository with my old key, but not the new one. The only error message I get is that the authentication failed, which forces me to connect with my password instead.

I am also trying to connect to another server via SFTP. I selected the Auth type 'Key pair (OpenSSH)' and entered the location of my private key file. This gives me the error message that <keyfile location>.pub does not exist. I am not sure why my public key is needed, but I generated a public key at the specified location using PuttyGen and now I get the message Server 'Sandbox' is not valid: Keypair 'C:\Keys\private_dsa.ppk' is corrupt or has unknown format.

I am not sure what I might be doing wrong.

Filezilla and PuTTY are both able to connect to the remote servers using the private key.

4 comments

Hello!

Putty keys *.ppk are not supported. Here is an issue for their support, feel free to vote for. Also note that EAP builds do not require public key anymore (see issue).

0

Thank you for the information. Its a shame the .ppk is not supported as I think that is one of the most common formats for Windows key generation. I did see a note in the ticket you referenced though that said "Takes time to convert to OpenSSh format." - is there a way to convert my .ppk to a format that PHPStorm will be able to use? I apologize if this is going off topic, I'm still pretty new to key based authentication, but would like to get these pieces to work.

0

Awesome, that got me where I needed to be.

For anyone that comes across this thread in the future that is doing this on Windows (the linked thread uses Linux to generate the public key) the steps I used are as follows:

  1. Load the private key in PuTTYGen
  2. Select Conversions > OpenSSH
  3. Save the file as id_dsa (or id_rsa depending on the type of key, no extension)
  4. Copy the text in the box at the top that says "Public key for pasting into OpenSSH authorized_keys file:"
  5. In the same folder where you saved the private key, create a file called id_dsa.pub (or id_rsa.pub, if its an RSA key)
  6. Paste the public key from your clipboard into that file and save.


These steps will give you an OpenSSH keypair that you can use for PhpStorm SSH operations.

1

Please sign in to leave a comment.