Your best friend for file transfer.

Fetch application logoFetch

SFTP Connection could not be opened... (39 posts)

  • Started 7 years ago by mflight
  • Latest reply 5 months ago from Steven
  • mflight Member

    I keep on getting this message when trying to connect:

    “SFTP connection to 70.42.33.4 could not be opened because the connection to the SFTP server could not be established or was lost.

    Try again, or contact the server administrator to verify that you can have the correct hostname, username, password, and authentication method, and that the server is running.”

    I'm putting in all the correct information according to the server administrator, so I really have no idea what's going wrong.

    Any insight?

    Posted 7 years ago #

  • Jim Matthews Administrator

    Hi,

    When I try to connect to 70.42.33.4 I get a connection refused error. It could be that the ssh server (which handles SFTP) has crashed or been turned off. I would talk to the system administrator again.

    Thanks,

    Jim Matthews
    Fetch Softworks

    Posted 7 years ago #

  • Deborah Member

    I repeatedly get this same error message, and system admin for the SFTP tells me it's on my end. Any suggestions for what to check? I am on Mac Powerbook G4, OS 10.4.11.

    Thanks.

    Posted 6 years ago #

  • Scott McGuire Administrator

    Hi Deborah,

    Each SFTP server has an "SSH host key" that enables secure transfers. When you connect to an SFTP server, Mac OS X stores that server's key for future use. If the server's key changes and no longer matches the one stored on your Macintosh, this could indicate a security problem. Some programs ignore the error; Fetch instead refuses to make the connection.

    So, one possibility is that your server's key may have changed, and that is the reason Fetch won't connect. You should try clearing your Mac's store of SSH keys, so that you can get a fresh key from the server.

    Please do the following to clear your SSH keys:

    * In Fetch, choose Fetch Help from the Help menu.
    * In the help window, search for "known hosts".
    * Double-click on the "RSA host key differs warning" help topic (it should be the one at the top of the list).
    * A help topic opens in the help window.
    * Scroll down to the "Delete the known_hosts file for me" link.
    * Click the link, and follow the instructions.

    Once that's done, try connecting to your server using SFTP again. If you're warned that "the authenticity of the host can't be established" (you may or may not be), that is normal and you should continue.

    Please let us know if this fixes the problem or not.

    Thanks,

    Scott McGuire
    Fetch Softworks

    Posted 6 years ago #

  • Deborah Member

    Hello Scott,

    Worked like a charm! Thanks so much. I'll pass the info onto my client, too, so they can troubleshoot that end. (They keep pushing Cyberduck, which is loaded with trouble, so I hope this will encourage them to support Fetch, which my colleagues and I agree is the only way to go.) Thanks again!

    Deborah

    Posted 6 years ago #

  • Scott McGuire Administrator

    Hi Deborah,

    You're welcome, we're glad to hear the problem is fixed.

    And thanks for your support!

    Best,

    Scott McGuire
    Fetch Softworks

    Edited 6 years ago #

  • Bob Member

    Fetch still has the problem I reported close to a year ago. I have a ubuntu server at work I connect to. I can successfully ssh/sftp from terminal anytime. When I use fetch with sftp I have to connect/reconnect MANY times until I get a connection. The ubuntu system has been upgraded to the latest version, I think this is a mac or fetch issue.

    Bob Sica

    Posted 6 years ago #

  • Jim Matthews Administrator

    Hi Bob,

    We'd like to help figure out what's going on with your ubuntu server. After trying to connect could you send the contents of the Fetch Transcript window to bugs@fetchsoftworks.com ?

    Thanks,

    Jim Matthews
    Fetch Softworks

    Posted 6 years ago #

  • Susan Member

    Fetch 5.7.3 (5H683) Intel (Web Store) running on Mac OS X 10.8.4 (12E55) Intel English
    StuffIt Engine 0x820, StuffIt SDK Version 10.1.1b1
    Partial serial FETCHEX001-NJSM-C6UM T
    Connecting to subrown@itcdland.csumb.edu port 22 (9/5/13 9:09 PM)
    SSH2_FXP_INIT 3
    SFTP connection to “itcdland.csumb.edu” could not be opened because the connection to the SFTP server could not be established or was lost. (Try again, or contact the server administrator to verify that you have the correct hostname, username, password, and authentication method, and that the server is running.
    Server responded: “ssh_exchange_identification: Connection closed by remote host

    ”)
    Connecting to subrown@itcdland.csumb.edu port 22 (9/5/13 9:09 PM)
    SSH2_FXP_INIT 3
    SFTP connection to “itcdland.csumb.edu” could not be opened because the connection to the SFTP server could not be established or was lost. (Try again, or contact the server administrator to verify that you have the correct hostname, username, password, and authentication method, and that the server is running.
    Server responded: “ssh_exchange_identification: Connection closed by remote host

    ”)
    Update check skipped at 9/5/13 9:10 PM (next check after 9/13/13 1:20 PM)
    Connecting to subrown@itcdland.csumb.edu port 22 (9/5/13 9:15 PM)
    SSH2_FXP_INIT 3
    SFTP connection to “itcdland.csumb.edu” could not be opened because the connection to the SFTP server could not be established or was lost. (Try again, or contact the server administrator to verify that you have the correct hostname, username, password, and authentication method, and that the server is running.
    Server responded: “ssh_exchange_identification: Connection closed by remote host

    ”)

    Posted 2 years ago #

  • Jim Matthews Administrator

    Hi Susan,

    Could you try the following?

    * Choose Utilities from the Go menu in the Finder
    * Open the Terminal application
    * Type the following:

    ssh -v subrown@itcdland.csumb.edu

    and then hit Return
    * Answer any questions and enter your password if prompted

    Are you able to login? If not, could you post the output you see in Terminal?

    Thanks,

    Jim Matthews
    Fetch Softworks

    Posted 2 years ago #

  • Susan Member

    Unable to log in.
    Terminal bash:

    Last login: Thu Sep 5 21:07:46 on console
    Susans-MacBook-Air:~ susanbrown$ ssh-v subrown@itcdland.csumb.edu
    -bash: ssh-v: command not found
    Susans-MacBook-Air:~ susanbrown$ ssh -v subrown@itcdland.csumb.edu
    OpenSSH_5.9p1, OpenSSL 0.9.8x 10 May 2012
    debug1: Reading configuration data /etc/ssh_config
    debug1: /etc/ssh_config line 20: Applying options for *
    debug1: /etc/ssh_config line 53: Applying options for *
    debug1: Connecting to itcdland.csumb.edu [198.189.249.134] port 22.
    debug1: Connection established.
    debug1: identity file /Users/susanbrown/.ssh/id_rsa type -1
    debug1: identity file /Users/susanbrown/.ssh/id_rsa-cert type -1
    debug1: identity file /Users/susanbrown/.ssh/id_dsa type -1
    debug1: identity file /Users/susanbrown/.ssh/id_dsa-cert type -1
    ssh_exchange_identification: Connection closed by remote host
    Susans-MacBook-Air:~ susanbrown$

    Posted 2 years ago #

  • Jim Matthews Administrator

    Thanks for trying that. The next thing I'd try is deleting your SSH known_hosts file. To do that:

    1) In the Finder, choose Go to Folder… from the Go menu
    2) Enter:

    ~/.ssh

    and click Go
    3) Drag known_hosts to the trash

    If that doesn't let you login I suspect there's a server problem, and I would recommend contacting the server administrator.

    Thanks,

    Jim Matthews
    Fetch Softworks

    Posted 2 years ago #

  • Steven Member

    I've tried the suggested fixes in the thread, but continue to experience a problem with Fetch 5.7.5, on Mac OSX 10.11, when trying to log into a server via SFTP, which prior to my update of OS to 10.11, worked fine.

    It doesn't appear to be a server side issue because the server administrators have logged in via the same method without a problem. Plus, I can log in with Cyberduck 4.7.2 with same log in details, no problem.

    When I try to access the server via SFTP, Fetch returns:

    "SFTP connection to "host name" could not be opened because the connection to the SFTP server could not be established or was lost.

    Try again, or contact the server administrator to verify that you have the correct hostname, username, password, and authentication method, and that the server is running. Server responded: "Received disconnect from<nnn.nn.nn.nn>: 6: Invalid packet
    Disconnected from <nnn.nn.nn.nn>"

    Anybody else having same issue? Any suggestions?

    Posted 8 months ago #

  • Jim Matthews Administrator

    Hi,

    Have you tried issuing the command

    ssh -v username@hostname

    (where username and hostname are your username and hostname) in Terminal? What output do you receive?

    Thanks,

    Jim Matthews
    Fetch Softworks

    Posted 8 months ago #

  • Steven Member

    Thanks for the info, Jim. Upon doing so, this output (where nnn.nnn.n.nn is an IP address):

    iMac27:~ steven$ ssh -v username@hostname
    OpenSSH_6.9p1, LibreSSL 2.1.7
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: /etc/ssh/ssh_config line 21: Applying options for *
    debug1: Connecting to steven [nnn.nnn.n.nn] port 22.
    debug1: connect to address nnn.nnn.n.nn port 22: Connection refused
    ssh: connect to host steven port 22: Connection refused

    Posted 8 months ago #

  • Jim Matthews Administrator

    Thanks for trying that. As the ssh output indicates, the server is rejecting connections from your Mac. You mentioned that you could connect from your Mac using Cyberduck. Is that an SFTP connection also, or regular FTP?

    Thanks,

    Jim Matthews
    Fetch Softworks

    Posted 8 months ago #

  • Steven Member

    Yes Jim, Cyberduck connects, and that's via SFTP also. In fact the bookmarked settings were imported from Fetch, at least that's what it says in the Notes.

    In case it helps, Cyberduck does alert, prior to connecting, "Unknown fingerprint - The fingerprint for the RSA key sent by the server is nn:nn:nn:nn:nn:nn:nn:nn:nn:nn:nn:nn:nn:nn:nn:nn."

    I've not included the actual letters and numbers in case that's some kind of security giveaway, but hopefully gives the picture.

    After clicking Allow, Cyberduck connects fine.

    Edited 8 months ago #

  • Jim Matthews Administrator

    Fetch uses OS X's OpenSSH ssh implementation, as does the command-line ssh command, while Cyberduck uses a different one. So this problem may be related to that difference.

    What do you see if you enter

    telnet hostname 22

    (where hostname is the name of your server) in Terminal?

    Thanks,

    Jim Matthews
    Fetch Softworks

    Posted 8 months ago #

  • Steven Member

    Via Terminal, entering:

    telnet hostname 22

    .. where hostname is the name of the server, returns the following ..

    Trying nnn.nn.nn.nn ...
    Connected to hostname.
    Escape character is '^]'.
    SSH-2.0-FileCOPA

    where nnn.nn.nn.nn is an IP address.

    Posted 8 months ago #

  • Jim Matthews Administrator

    Thanks for trying that. So the SFTP server isn't refusing the connection immediately, only after you try to connect.

    One more thing to try in Terminal:

    sftp -v username@hostname

    If that doesn't work I'd recommend contacting FileCOPA, the vendor of the SFTP server software, and letting them know that since you upgraded to OS X 10.11 you can't connect to their server with Fetch or the OS X command-line sftp program, but that you can still connect with Cyberduck. You can contact them here:

    https://www.filecopa.com/support.php

    Thanks,

    Jim Matthews
    Fetch Softworks

    Posted 8 months ago #

  • Steven Member

    This is what's returned by Terminal after entering:

    sftp -v username@hostname

    ----
    OpenSSH_6.9p1, LibreSSL 2.1.7
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: /etc/ssh/ssh_config line 21: Applying options for *
    debug1: Connecting to steven [nnn.nnn.n.nn] port 22.
    debug1: connect to address nnn.nnn.n.nn port 22: Connection refused
    ssh: connect to host steven port 22: Connection refused
    Connection closed
    ----

    The above prompted a thought, after noticing "Connecting to steven".

    My username is 'Firstname Lastname', ie. I have a space in my username. It's the same for both Fetch and Cyberduck, but could that be making the difference?

    Posted 8 months ago #

  • Steven Member

    This is an ongoing problem from earlier, still unresolved.

    However perhaps this additional info will give somebody a clue.

    The problem exists using SFTP with Fetch 5.7.5 on MacOS X 10.11.2. Accessing the same server using CyberDuck 4.7.3 does not present a problem.

    The server I'm accessing has FileCOPA 9.01 installed on a Windows 2008 server. If I go into the FileCOPA logs after trying to access vis Fetch, it says this:

    2016-01-15 05:28:26 nnn.nnn.nnn.nnn "" - - - - - "SFTP: Connected"
    2016-01-15 05:28:26 nnn.nnn.nnn.nnn "" - - - - - "SFTP: Error - Key exchange failed."
    2016-01-15 05:28:26 nnn.nnn.nnn.nnn "" - - - - - "SFTP: Disconnected"

    What clue does "SFTP: Error - Key exchange failed." give ?

    Many thanks

    Posted 5 months ago #

  • Jim Matthews Administrator

    Hi,

    I apologize for not seeing your post from 3 months ago. I would try:

    sftp -v "username@hostname"

    in Terminal, i.e. put quotes around your username@hostname (to deal with the fact that your username has a space in it). What do you see then?

    Thanks,

    Jim Matthews
    Fetch Softworks

    Posted 5 months ago #

  • Caroling Wholeo Member

    I use Fetch on Mac to connect using SFTP to my current web host.
    Now trying to make a new connection using SFTP to a new web host. I have generated key in their cpanel. Authorized the public one there. Downloaded the private. Made a config file identifying where the private key is. I have made the connection shortcut look like the previous one. And I get "SFTP connection to x could not be opened because the connection to the SFTP server could not be established or was lost. (Server responded: "Permission denied (publickey).
    I have asked for web host support help. So far they have just asked me what credentials I'm using. I don't know where the problem is. Fetch, Mac, key, server, etc.
    Thanks for giving me a clue.

    Posted 5 months ago #

  • Caroling Wholeo Member

    I use Fetch on Mac to connect using SFTP to my current web host.
    Now trying to make a new connection using SFTP to a new web host. I have generated key in their cpanel. Authorized the public one there. Downloaded the private. Made a config file identifying where the private key is. I have made the connection shortcut look like the previous one. And I get "SFTP connection to x could not be opened because the connection to the SFTP server could not be established or was lost. (Server responded: "Permission denied (publickey).
    I have asked for web host support help. So far they have just asked me what credentials I'm using. I don't know where the problem is. Fetch, Mac, key, server, etc.
    Thanks for giving me a clue.

    Posted 5 months ago #

  • Steven Member

    Responding to Jim Matthews' post of 2 days ago ...

    Thanks Jim. I did as you suggested. The response back from Terminal was:

    iMac27:~ steven$ sftp -v "username@hostname"
    OpenSSH_6.9p1, LibreSSL 2.1.8
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: /etc/ssh/ssh_config line 21: Applying options for *
    debug1: Connecting to <username@ hostname> [nnn.nn.nn.nn] port 22.
    debug1: Connection established.
    debug1: key_load_public: No such file or directory
    debug1: identity file /Users/steven/.ssh/id_rsa type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /Users/steven/.ssh/id_rsa-cert type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /Users/steven/.ssh/id_dsa type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /Users/steven/.ssh/id_dsa-cert type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /Users/steven/.ssh/id_ecdsa type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /Users/steven/.ssh/id_ecdsa-cert type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /Users/steven/.ssh/id_ed25519 type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /Users/steven/.ssh/id_ed25519-cert type -1
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_6.9
    debug1: Remote protocol version 2.0, remote software version FileCOPA
    debug1: no match: FileCOPA
    debug1: Authenticating to <hostname>:22 as 'username'
    debug1: SSH2_MSG_KEXINIT sent
    debug1: SSH2_MSG_KEXINIT received
    debug1: kex: server->client arcfour256 umac-64@openssh.com none
    debug1: kex: client->server arcfour256 umac-64@openssh.com none
    debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<8192<8192) sent
    Connection closed by nnn.nn.nn.nn
    Connection closed
    iMac27:~ steven$ iMac27:~ steven$ sftp -v "username@hostname"
    -bash: iMac27:~: command not found
    iMac27:~ steven$ OpenSSH_6.9p1, LibreSSL 2.1.8
    -bash: OpenSSH_6.9p1,: command not found
    iMac27:~ steven$ debug1: Reading configuration data /etc/ssh/ssh_config
    -bash: debug1:: command not found
    iMac27:~ steven$ debug1: /etc/ssh/ssh_config line 21: Applying options for *
    -bash: debug1:: command not found
    iMac27:~ steven$ debug1: Connecting to <hostname> [nnn.nn.nn.nn] port 22.
    -bash: debug1:: command not found
    iMac27:~ steven$ debug1: Connection established.
    -bash: debug1:: command not found
    iMac27:~ steven$ debug

    Posted 5 months ago #

  • Jim Matthews Administrator

    Steven: Thanks for trying that; it doesn't look like the space in your username is the issue. Have you tried contacting FileCOPA support at https://www.filecopa.com/support.php to see if they know about a problem with logins from OS X 10.11, and/or a problem with logins from OpenSSH 6.9?

    Caroling: Thanks for contacting us here. I would try opening Terminal and entering:

    ssh -vvv -i path/to/your/private/key username@hostname

    where path/to/your/private/key is the path to your private key file on your Mac (which will have a name like id_rsa), and username@hostname are your login username and hostname. Do you get any useful output from that?

    Thanks,

    Jim Matthews
    Fetch Softworks

    Posted 5 months ago #

  • Steven Member

    Thanks Jim, have lodged a query with FILECopa. I'll let you know if I have any luck.

    Posted 5 months ago #

  • Jim Matthews Administrator

    Steven: Another thing to check is the version number of the FileCOPA server software. It may be that there's an update available.

    Jim Matthews
    Fetch Softworks

    Posted 5 months ago #

  • Steven Member

    Thanks for suggestions Jim. I did update that though. It was running 7.01 but since updated it to 9.01. Unfortunately didn't fix the problem though.

    In case somebody reads this with a similar problem, one thing I did discover is that FileCOPA auto blacklists your IP after 3 unsuccessful login attempts. Solution there is to manually whitelist your IP address.

    FileCOPA are looking into. Will post if solved.

    Posted 5 months ago #