Failed to connect to SFTP server error

Get help for specific problems
Posts: 6
Joined: 7 Jul 2016

Chen

Unable to establish a connection via FFS SFTP to Solaris 9. Error message as follows:
Failed to connect to SFTP server <server address>
Error code LIBSSB2_ERROR_NONE: (libssh2_session_handshake), which is related to invalid socket. I was able to use WinSCP with the same protocol and ssh access via command line.
Posts: 41
Joined: 10 Jul 2016

JustAnotherUser

Same problem for me (libssh2_session_handshake), trying connecting to FTP.
My Provider is all-inkl.com.
Posts: 32
Joined: 11 Jul 2016

schnappi

FreeFileSync might only be able to connect with a RSA hostkey (not sure what FreefileSynce is actually compatible with, the developers will probably have to let you know). Your SFTP server might only serve ecdsa, DSA, or something else keys.

If you have root access to your server check /etc/ssh/sshd_config (or where your SSH config file is). Post the contents of that file here or post all the lines that start with "HostKey."
Posts: 6
Joined: 7 Jul 2016

Chen

Thanks for the info. The HostKey on this server:
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
Posts: 41
Joined: 10 Jul 2016

JustAnotherUser

Now I also tried to connect to a QNAP-Server.
In its configuration I activated "FTP with SSL/TLS (Explicit)".
I can connect to it properly when using e.g. the TotalCommander as a client.
But with FFS I receive this exception:
Fehlercode LIBSSH2_ERROR_TIMEOUT: Failed getting banner (libssh2_session_handshake)
I'm quite a bit unsure right now, if the "FTP with SSL/TLS (Explicit)", which is supported by the QNAP, corresponds to the SFTP supported by FFS at all?
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

SFTP and FTP with SSL are two different protocols. FreeFileSync (at least currently) only supports SFTP as implemented by libssh2.
Posts: 32
Joined: 11 Jul 2016

schnappi

Thanks for the info. The HostKey on this server:
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_keyChen
Can you connect to your server with PuTTY?
Posts: 6
Joined: 7 Jul 2016

Chen

Hi schnappi,
Putty gave me a different error (i.e. the error from putty is connection closed by remote host, <ip address not found error>). However, I was able to logon by issue a ssh command from the ssh that was installed on the same PC to the remote server. Greatly appreciated for your replied.
Thanks
Posts: 41
Joined: 10 Jul 2016

JustAnotherUser

@Zenju:
Hm, thats too bad.
Because FTP without any encryption isn't implemented/supported, I even can't connect to a local FTP-server for backup purposes.
But I agree your opinion, that encrypted connections have to be implemented first, because of security.

What do you think, when FTP with SSL will be implemented?
As it looks now, all servers I tried to connect (all I would like to use) just support this protocol.
Is it a big bunch of work?

Edit:
(Am I right that it would be "libeay32.dll" and "ssleay32.dll" then, which have to be implemented?)
Posts: 41
Joined: 10 Jul 2016

JustAnotherUser

Another important reason, at least for me, but I guess for others also, to support unencrypted FTP soon is:

The FTP transfer performance of my local QNAP is very, very slow.
When I use an unencrypted connection then it is appr. 10 times faster.

So for such/local environments it will be a big improvement!
Posts: 32
Joined: 11 Jul 2016

schnappi

Can you extrapolate on this sentence: "I was able to logon by issue a ssh command from the ssh that was installed on the same PC to the remote server."

Does this mean that you were able to open an SSH session or you were able to login locally?

If connecting via putty does not work I think that the issue is on the server side.
Posts: 6
Joined: 7 Jul 2016

Chen

Yes, I was able to open an SSH session and login to the server from a Windows 7 PC. However, no so successful with putty. Note: WinSCP uses SSH File Transfer protocol as well and I was able to connect to the remote server with SFTP connection. Thanks
Posts: 6
Joined: 7 Jul 2016

Chen

installed putty release 0.63 2013 version and no problem login to the remote server. I was using a very old version of putty in 2007. So my problem is within FreeFileSync SFTP. Any suggestion is greatly appreciated.
Posts: 32
Joined: 11 Jul 2016

schnappi

What are the contents of your SSH log on your server when you try to connect with FreeFileSync?

You can find the log here on a Debian based system: /var/log/auth.log
Posts: 6
Joined: 7 Jul 2016

Chen

Hi schnappi,
Thanks for your help. The problem was with the SSL&SSH version on the remote server. Installed/configured openssl-1.0.2 and openssh-7.2p2 and SFTP is working for FFS. The actual error was "ID 800047 auth.crit fatal: padding error: need 168 block 16 mod 8". This error is related to the SSH version that come with the base Solaris 9 OS.