liximomo / vscode-sftp

Super fast sftp/ftp extension for VS Code
MIT License
1.5k stars 260 forks source link

Accept using a local file for private key on hop #756

Open windware-ono opened 4 years ago

windware-ono commented 4 years ago

It took a while for me to figure out that the private key file that is read on the target has to be on the hop machine instead of the local machine like it's usually done with ProxyCommand on OpenSSH but can you allow an option to read from a local file too?

Suppose that multiple people use a same user on the hop server, the hop server has to have everyone's private key to the target server, which would be readable by everyone.

y-kawa commented 4 years ago

I agree with this Issue. 👍

Connecting to the target server using a local key is at least equivalent to using This was possible in version 1.9.4.

Here's the version 1.9.4. sftp.json setting. It's a puzzled setting, but it works...

// single hop
{
  "host": "hop server address",
  "username": "target username",
  "privateKeyPath": "C:\\mykey\\target_server_access.key", // on the local
  "remotePath": "/usr/local/myapp", // target server romotePath
  "hop": {
      "host": "target server address",
      "username": "hop username",
      "privateKeyPath": "C:\\mykey\\hop_server_access.key" // on the local
  }
}