icetee / remote-ftp

FTP/FTPS/SFTP client for Atom.io
MIT License
558 stars 102 forks source link

Can't find ssh config file #1072

Open joshtemple opened 6 years ago

joshtemple commented 6 years ago

Prerequisites

Description

I'm trying to use ProxyCommand through my ssh config file to access a server through a jumpbox. This seems theoretically possible but it doesn't seem like Remote-FTP is finding my config file. I supplied the path in Remote-FTP > Settings as /Users/Josh.Temple/.ssh/config, but I'm getting the following error:

Error: getaddrinfo ENOTFOUND spark spark:21.

My .ftpconfig file looks like this:

{
    "protocol": "sftp",
    "host": "spark"
}

My ssh config file is as follows:

Host spark
    Hostname [IP Address of Destination Server]
    IdentityFile [Path to Identity File]
    User [Username]
    ProxyCommand ssh -l [Jumpbox User] -i [Path to Private Key] -q [Jumpbox URL] -W %h:%p
    DynamicForward localhost:[Port to Forward]

Versions

Mac OS Sierra 10.12.6 Atom: 1.19.6 Electron: 1.6.9 Chrome: 56.0.2924.87 Node: 7.4.0

icetee commented 6 years ago

Unfortunately, I do not know how ProxyCommand and Dynamic Forward work. I'm trying to look at it. With these settings, it works perfectly well on Windows and MacOS. Related of https://github.com/icetee/remote-ftp/issues/990

My simple .ftpconfig file:

{
    "protocol": "sftp",
    "host": "domain.country",
    "hostName": "Hello Server",
    "remote": "/home/icetee/.meteor/"
}

And my partial ssh config (in Windows)

Host domain.country
    HostName domain.country
    IdentityFile C:\Users\icetee\.ssh\id_rsa
    User icetee
    Port XYZW
geoschwa commented 6 years ago

I'm facing the same problem as joshtemple above.

As a Workaround I'm currently mounting the remote server's filesystem with sshfs. Works but feels very slow.

Atom 1.22.1x64 Remote FTP 2.1.0 On Ubuntu 16.04.3 LTS

ajostergaard commented 6 years ago

@icetee in your example above domain.country appears to be the same value in .ftpconfig as the actual address configured against HostName in the config file. Part of the purpose of the ssh config file is to allow a user to use different local pseudonyms to connect to the same host in different ways (e.g. with different keys). Hence could you try a configuration like this:

.ftpconfig:

{
    "protocol": "sftp",
    "host": "somename",
    "hostName": "Hello Server",
    "remote": "/home/icetee/.meteor/"
}

and config:

Host somename
    HostName domain.country
    IdentityFile C:\Users\icetee\.ssh\id_rsa
    User icetee

When I do this I get the error described above.