Search code examples
phpstormssh-keysopensshphpstorm-2018.2

PhpStorm "rsa key is corrupt or has the wrong version"


I'm using PhpStorm 2018.2 and attempting to connect to remote host using SSH key (I can connect via ssh on terminal).

When I enter the (newly created) rsa key into the remote host settings I get the error "'{path/to/key}_rsa' is corrupt or has unknown format" ... see image attached.

enter image description here

I have seen some bits about converting the key to an ssh2 key using this command

ssh-keygen -e -f ~/.ssh/key_rsa > ~/.ssh/key_rsa_ssh2

and using that in PhpStorm instead but with no luck.


Solution

  • To expand on @eugenemorozov's answer. I had to do these 2 points.

    • add the private key(s) to ssh-agent using ssh-add command; i did this by following this guide.

    • choose OpenSSH Config and authentication agent authentication type option when configuring SFTP Deployment Connection options.