Vincent
Vincent

Reputation: 1

PhpStorm SSH / SFTP cygwin

I want to use my cygwin configuration for SSH ou SFTP connection but doesn't work.

My configucation file "config" is in directory C:\cygwin64\home\<username>\.ssh. This configuration file define an SSH proxy jump and send some environment variables. This configuration file work fine in cygwin to connect in SSH or SFTP.

In PhpStorm settings I've specified the shell path in Tools > Terminal to be C:\cygwin64\bin\bash.exe --login -i. All local terminal use cygwin fine. But the ssh connection don't use my configuration file. I tried copying configuration in C:\Users\<username>\.ssh directory but that does not work.

Can you help me?

Upvotes: 0

Views: 145

Answers (2)

Vincent
Vincent

Reputation: 1

I found the solution. You need to install the latest version of OpenSSH. To achieve this, I did the following actions:

  1. Installing the scoop package manager (https://scoop.sh/) using PowerShell

    $ Set-ExecutionPolicy RemoteSigned -scope CurrentUser Answer Y

    $ Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')

  2. Installing OpenSSH

    $ scoop install win32-openssh

    normally the installation modifies the environment variable %PATH% to add the path something like C:\Users\<username>\scoop\shims. Otherwise you have to add it.

  3. Modification of the environment variable %PATH% to remove the path C:\Windows\System32\OpenSSH

  4. Enable the "OpenSSH Authentication Agent" service On keyboard press Windows + R

    Type: services.msc and press Enter.

    Double click on the "OpenSSH Authentication Agent" service

    Select the "Automatic" start type and start the service.

After these actions, I was able to connect from the Windows cmd terminal. I tested from PhpStorm and it works too.

Upvotes: 0

Dmitrii
Dmitrii

Reputation: 3557

Generally, creating %USERPROFILE%/.ssh/config file pointing to the actual location of keys (using a valid Windows path) should help. But PhpStorm does not support ProxyJump and ProxyCommand instructions in it because there is no support for it from OpenSSH client's Windows port and we cannot use Cygwin or MinGW OpenSSH clients, which support proxying, but require running in theirs own shell subsystem. Here's a related bug report: https://youtrack.jetbrains.com/issue/IDEA-214679

Upvotes: 1

Related Questions