Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

phpstorm SSH won't bring me the next button

How can I use a SSH / SFTP connection to my server using phpstorm?

If I add a remote Server, I can choose the private Key file (putty) but he won't activate the "Next" button :( If I say "Login as anonymous" it will highlight the Next-button but thats not what I want :):)

I've searched the Docs but dind't find an helpful answer. Maybe you got the same problem in past?

EDIT:
As answered, I set up the server informations. Now, it returns me an error:

Server 'Check' is not valid: <html>Keypair 'C:\Program Files\putty\riegelp.ppk' is corrupt or 
has unknown format.<br> Only SSH2 keys in OpenSSH format or PuTTY Private Key *.ppk keys are 
supported.<br> Error message: The cipher 'aes256-cbc' is required, but it is not available.
</html>.
like image 665
TheTom Avatar asked Oct 01 '14 08:10

TheTom


3 Answers

This is caused by Java not coming with the necessary encryption packages in its default install. PHPStorm is bundled with its own copy of Java so this needs to have the extended encryption added.

First work out which version of Java has come with your PHPStorm install, this can be done by finding the PHPStorm java.exe location and running it from the cmd with -version e.g.:

"C:\Program Files (x86)\JetBrains\PhpStorm 8.0.1\jre\jre\bin\java.exe" -version
java version "1.7.0_60"

Next download the correct "Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files"

  • Java 6 : http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html
  • Java 7 : http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html
  • Java 8 : http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html

Follow the install docs, you replace the following files in the security dir with the new ones from the download

C:\Program Files (x86)\JetBrains\PhpStorm 8.0.1\jre\jre\lib\security
local_policy.jar
US_export_policy.jar

Open up PHPStorm and SFTP with aes encrypted keys should be working

like image 78
chris Avatar answered Nov 17 '22 00:11

chris


source: http://baligena.com/ssh-private-key-conversion/

In attempt to login into a ssh server using a private key in phpstorm I ran accross this error.

Keypair 'private_key.ppk' is corrupt or has unknown format. Only SSH2 keys in OpenSSH format or PuTTY Private Key *.ppk are supported. Error message: The cipher 'aes256-cbc' is required, but it is not available.

This error will not allow the "next" and "test connection" button to appear

The issue here is that the private key format is incorrect. You'll will need to convert the private key to open ssh format. And the way to do that is

Open your private key in PuTTYGen

Top menu “Conversions”->”Export OpenSSH key”.

Save the new OpenSSH key when prompted.

like image 29
baligena Avatar answered Nov 17 '22 00:11

baligena


Edit Jan 2018: It seems that since some time in 2017 JetBrains packs their IDEs with 64-bit Java by default and they supply the needed policy jars within jre64\lib\security\policy folder. That makes things much simpler, as there is no need to install a copy of 64-bit JDK manually in one of those folders listed below and to copy security files there.

To fix the issue now, navigate to %IDE_ROOT%\jre64\lib\security directory and copy files over from an underlying policy\unlimited folder.

Original:

While the answer chris has given is the correct one, one more clarification is in order. If you are using any JetBrains' product in 64-bit mode, then be aware, that 64-bit Java is not packed with it. You must download and install 64-bit Java DK (not JRE) yourself.

That can be the reason behind rawb's comment to chris' answer — the IDE is falling back to system-level Java. I would not recommend to follow through with rawb's advice and replace security files in your system Java. Instead, it is better to configure your IDE to run under a different copy of Java.

This article at JetBrains' support pages on selecting the version of Java the IDE will run under gives an insight in the order JDK version is looked up in. It's a little outdated as far as I can tell. If what is written there does not work for you, here's the order I figured to be working:

  1. %YOURIDE%_JDK_64 environment variable; in case of PHPStorm it is PHPSTORM_JDK_64, for WebStorm it is WEBIDE_JDK_64, etc.

  2. %IDE_ROOT%\jre64 directory

  3. System Registry

  4. JDK_HOME environment variable
  5. JAVA_HOME environment variable

Now, install (or copy system-level) JDK under one of those paths and replace files as suggested.

You will have to tend to this copy of Java yourself, but, in my opinion, it will be more secure than to change system-wide JDK properties.

like image 2
pycbouh Avatar answered Nov 16 '22 22:11

pycbouh