Sublime Forum

Problem with SFTP - connection refused

#1

Hi,

I know it’s not the first SFTP package topic, but the other didn’t help me to solve my problem. That’s why I’m now initiating a new one.

I’m having a problem with the SFTP package and I need some initial help to get the first connection up and running.

I’m using sublime text on a ubuntu system and I already have stored a lot of ssh-destinations in my config - all of them are working fine when I’m trying on the command line. But with sublime text I’m constantly getting “connection refused” messages. Here exactly what I’m doing.

Installed ssh packages

tho@bebektor:~$ dpkg -l |egrep openssh
ii  openssh-client 1:7.2p2-4ubuntu2.1           amd64     secure shell (SSH) client, for secure access to remote machines
ii  openssh-server 1:7.2p2-4ubuntu2.1           amd64     secure shell (SSH) server, for secure access from remote machines
ii  openssh-sftp-server 1:7.2p2-4ubuntu2.1      amd64     secure shell (SSH) sftp server module, for SFTP access from remote machines

The relevant ssh-config excerption

tho@bebektor:~/.ssh$ cat config
Host jump-one
  User tho
Host bra-jump
  User tho
  ProxyCommand ssh jump-one -W %h:%p
Host bra-netauto2 bra-na2
  User dtadmin
  ProxyCommand ssh bra-jump -W %h:%p

sftp_config.json in the mapped directory

{
    // The tab key will cycle through the settings when first created
    // Visit http://wbond.net/sublime_packages/sftp/settings for help

    // sftp, ftp or ftps
    "type": "sftp",

    "save_before_upload": true,
    "upload_on_save": false,
    "sync_down_on_open": false,
    "sync_skip_deletes": false,
    "sync_same_age": true,
    "confirm_downloads": false,
    "confirm_sync": true,
    "confirm_overwrite_newer": false,

    "host": "bra-na2",
    "user": "dtadmin",
    //"password": "password",
    //"port": "22",

    "remote_path": "/home/dtadmin/",
    "ignore_regexes": [
        "\\.sublime-(project|workspace)", "sftp-config(-alt\\d?)?\\.json",
        "sftp-settings\\.json", "/venv/", "\\.svn/", "\\.hg/", "\\.git/",
        "\\.bzr", "_darcs", "CVS", "\\.DS_Store", "Thumbs\\.db", "desktop\\.ini"
    ],
    //"file_permissions": "664",
    //"dir_permissions": "775",

    //"extra_list_connections": 0,

    "connect_timeout": 30,
    //"keepalive": 120,
    //"ftp_passive_mode": true,
    //"ftp_obey_passive_host": false,
    //"ssh_key_file": "~/.ssh/id_rsa",
    "sftp_flags": ["-F", "~/.ssh/config"],
    //"preserve_modification_times": false,
    //"remote_time_offset_in_hours": 0,
    //"remote_encoding": "utf-8",
    //"remote_locale": "C",
    //"allow_config_upload": false,
}

And then: right click on mapped directory -> SFTP/FTP -> Download Folder => results in “connection refused”

What is my fault. I’m sticking at that point and need help.

0 Likes

#2

I’m on step further. I tcpdumped a little bit and figured out that my laptop didn’t even send one packet towards the destination host. I realized that the tilde sign in

"sftp_flags": ["-F", "~/.ssh/config"],

represents a relative path - not the homedirectory. I set it to the absolute path and now at least packets are sent. But the next problem is ‘Invalid login credentials’. Even with a really simple example:

Host u14
  User root
  HostName 80.154.63.26

I don’t understand it. Is there anybody who has an idea?

### UPDATE

Its strange. I’m another step further. Now I’m now able to sync with an server even if it is across an ssh-tunnel. But tell me, why do I need to enter my pass-phrase when on my system a ssh-agent is running?

0 Likes