Negotiation failed. The connection was closed by the server.

0 votes
asked May 3 by mabayraktar (120 points)

Hi,
I'm receiving the following error message when trying to connect with the following code.I am using rebex.sftp 2018R2

Dim thisSFTP = New Rebex.Net.Sftp
Dim par As New SshParameters
par.HostKeyAlgorithms = SshHostKeyAlgorithm.Any 
par.KeyExchangeAlgorithms = par.KeyExchangeAlgorithms Or SshKeyExchangeAlgorithm.DiffieHellmanGroup1SHA1
thisSFTP.LogWriter = new Rebex.FileLogWriter(FtpDebugFile, Rebex.LogLevel.Debug)
thisSFTP.Connect(Instance.remoteHost, Instance.remoteHostPort, par)

The log:

2019-05-03 09:37:11.654 Opening log file.

2019-05-03 09:37:11.654 INFO FileLogWriter(1)[1] Info: Assembly: Rebex.Common 2018 R2 for .NET 4.0-4.7

2019-05-03 09:37:11.667 INFO FileLogWriter(1)[1] Info: Platform: Windows 6.2.9200 64-bit; CLR: 4.0.30319.42000

2019-05-03 09:37:11.667 DEBUG FileLogWriter(1)[1] Info: Culture: en; Windows-1252

2019-05-03 09:37:11.699 INFO Sftp(1)[1] Info: Connecting to 10.35.81.97:22 using Sftp.

2019-05-03 09:37:11.699 INFO Sftp(1)[1] Info: Assembly: Rebex.Sftp 2018 R2 for .NET 4.0-4.7

2019-05-03 09:37:11.699 INFO Sftp(1)[1] Info: Platform: Windows 6.2.9200 64-bit; CLR: 4.0.30319.42000

2019-05-03 09:37:11.699 DEBUG Sftp(1)[1] Info: Culture: en; Windows-1252

2019-05-03 09:37:11.730 DEBUG ProxySocket(1)[1] Proxy: Connecting to xx.yy.zz.tt:22 (no proxy).

2019-05-03 09:37:11.981 DEBUG Sftp(1)[1] SSH: Server is 'SSH-2.0-OpenSSH_6.6'.

2019-05-03 09:37:11.995 INFO Sftp(1)[1] SSH: Negotiation started.

2019-05-03 09:37:12.230 DEBUG Sftp(1)[6] SSH: SSH connection closed.

2019-05-03 09:37:12.261 DEBUG Sftp(1)[1] SSH: Group exchange.

2019-05-03 09:37:12.261 ERROR Sftp(1)[1] SSH: Negotiation failed. The connection was closed by the server.

2019-05-03 09:37:12.277 ERROR Sftp(1)[1] Info: Rebex.Net.SshException: The connection was closed by the server.

at Rebex.Net.SshSession.wwqi(hffs acz, Boolean ada)

at nsxp.lsll(SshSession axg, Byte[] axh, Byte[] axi, Byte[] axj, Byte[] axk, nsxf& axl, Byte[]& axm, SshPublicKey& axn)

at Rebex.Net.SshSession.wwqz(Byte[] adz)

at Rebex.Net.SshSession.Negotiate()

at Rebex.Net.Sftp.xppp.qjky(ctch ame, Boolean amf)

at Rebex.Net.Sftp.ypka(String qi, Int32 qj, SshParameters qk, ctch ql)

Applies to: Rebex SFTP

2 Answers

0 votes
answered May 3 by Lukas Matyska (54,110 points)

The issue is very probably caused by client preferred key exchange algorithm.

Rebex SFTP prefers DSA keys. This preference is for historical reasons, but it occasionally causes issues because some SFTP/SSH servers are misconfigured – they announce support for DSA and accept client attempting to use this host key algorithm, but they are unable to actually perform the SSH negotiation with a DSA key.

We already changed this to RSA in 2019 R1 release. Since you are using 2018 R2, you can set it manually like this:

par.PreferredHostKeyAlgorithm = SshHostKeyAlgorithm.RSA

Please, give it a try.

commented May 7 by Lukas Matyska (54,110 points)
Thank you for sharing VERBOSE log. It showed that the server closed the connection immediately after receiving initial SSH_MSG_KEXINIT.
Can you please share here (or send to support@rebex.net) VERBOSE log from the working 2017r1 version? So we can compare those two. It will be very helpful. Thank you.
commented May 8 by mabayraktar (120 points)
2017R1 version

>11:34:58.936 Info Info: Connecting to 10.35.81.97:22 using Sftp 3.0.6249.0.
>11:34:59.064 Verbose SSH: Sending data:
>0000 |53-53-48-2D-32-2E-30-2D 52-65-62-65-78-53-53-48| SSH-2.0-RebexSSH
>0010 |5F-33-2E-30-2E-36-32-34 39-2E-30-0D-0A         | _3.0.6249.0..
>11:34:59.296 Verbose SSH: Received data:
>0000 |53-53-48-2D-32-2E-30-2D 4F-70-65-6E-53-53-48-5F| SSH-2.0-OpenSSH_
>0010 |36-2E-36-0D-0A                                 | 6.6..
>11:34:59.327 Debug SSH: Server is 'SSH-2.0-OpenSSH_6.6'.
>11:34:59.374 Info SSH: Negotiation started.
>11:34:59.389 Verbose SSH: Received packet SSH_MSG_KEXINIT (1342 bytes).
>0000 |14-E0-24-B9-D7-D0-72-30 55-C4-E7-4C-22-CC-8A-41| ..$...r0U..L"..A
>0010 |A2-00-00-00-59-64-69-66 66-69-65-2D-68-65-6C-6C| ....Ydiffie-hell
>0020 |6D-61-6E-2D-67-72-6F-75 70-2D-65-78-63-68-61-6E| man-group-exchan
>0030 |67-65-2D-73-68-61-31-2C 64-69-66-66-69-65-2D-68| ge-sha1,diffie-h
>0040 |65-6C-6C-6D-61-6E-2D-67 72-6F-75-70-31-34-2D-73| ellman-group14-s
>0050 |68-61-31-2C-64-69-66-66 69-65-2D-68-65-6C-6C-6D| ha1,diffie-hellm
>0060 |61-6E-2D-67-72-6F-75-70 31-2D-73-68-61-31-00-00| an-group1-sha1..
>0070 |00-1B-73-73-68-2D-72-73 61-2C-73-73-68-2D-64-73| ..ssh-rsa,ssh-ds
>0080 |73-2C-73-73-68-2D-65-64 32-35-35-31-39-00-00-00| s,ssh-ed25519...
>0090 |BB-61-65-73-31-32-38-2D 63-74-72-2C-61-65-73-31| .aes128-ctr,aes1
>00A0 |39-32-2D-63-74-72-2C-61 65-73-32-35-36-2D-63-74| 92-ctr,aes256-ct
>00B0 |72-2C-61-72-63-66-6F-75 72-32-35-36-2C-61-72-63| r,arcfour256,arc
>00C0 |66-6F-75-72-31-32-38-2C 63-68-61-63-68-61-32-30| four128,chacha20
>00D0 |2D-70-6F-6C-79-31-33-30 35-40-6F-70-65-6E-73-73| -poly1305@openss
>00E0 |68-2E-63-6F-6D-2C-61-65 73-31-32-38-2D-63-62-63| h.com,aes128-cbc
>00F0 |2C-33-64-65-73-2D-63-62 63-2C-62-6C-6F-77-66-69| ,3des-cbc,blowfi
>0100 |73-68-2D-63-62-63-2C-63 61-73-74-31-32-38-2D-63| sh-cbc,cast128-c
>0110 |62-63-2C-61-65-73-31-39 32-2D-63-62-63-2C-61-65| bc,aes192-cbc,ae
>0120 |73-32-35-36-2D-63-62-63 2C-61-72-63-66-6F-75-72| s256-cbc,arcfour
>0130 |2C-72-69-6A-6E-64-61-65 6C-2D-63-62-63-40-6C-79| ,rijndael-cbc@ly
>0140 |73-61-74-6F-72-2E-6C-69 75-2E-73-65-00-00-00-BB| sator.liu.se....
>0150 |61-65-73-31-32-38-2D-63 74-72-2C-61-65-73-31-39| aes128-ctr,aes19
>0160 |32-2D-63-74-72-2C-61-65 73-32-35-36-2D-63-74-72| 2-ctr,aes256-ctr
>0170 |2C-61-72-63-66-6F-75-72 32-35-36-2C-61-72-63-66| ,arcfour256,arcf
>0180 |6F-75-72-31-32-38-2C-63 68-61-63-68-61-32-30-2D| our128,chacha20-
>0190 |70-6F-6C-79-31-33-30-35 40-6F-70-65-6E-73-73-68| poly1305@openssh
>01A0 |2E-63-6F-6D-2C-61-65-73 31-32-38-2D-63-62-63-2C| .com,aes128-cbc,
>01B0 |33-64-65-73-2D-63-62-63 2C-62-6C-6F-77-66-69-73| 3des-cbc,blowfis
>01C0 |68-2D-63-62-63-2C-63-61 73-74-31-32-38-2D-63-62| h-cbc,cast128-cb
>01D0 |63-2C-61-65-73-31-39-32 2D-63-62-63-2C-61-65-73| c,aes192-cbc,aes
>01E0 |32-35-36-2D-63-62-63-2C 61-72-63-66-6F-75-72-2C| 256-cbc,arcfour,
>01F0 |72-69-6A-6E-64-61-65-6C 2D-63-62-63-40-6C-79-73| rijndael-cbc@lys
>0200 |61-74-6F-72-2E-6C-69-75 2E-73-65-00-00-01-76-68| ator.liu.se...vh
>0210 |6D-61-63-2D-6D-64-35-2D 65-74-6D-40-6F-70-65-6E| mac-md5-etm@open
>0220 |73-73-68-2E-63-6F-6D-2C 68-6D-61-63-2D-73-68-61| ssh.com,hmac-sha
>0230 |31-2D-65-74-6D-40-6F-70 65-6E-73-73-68-2E-63-6F| 1-etm@openssh.co
>0240 |6D-2C-75-6D-61-63-2D-36 34-2D-65-74-6D-40-6F-70| m,umac-64-etm@op
>0250 |65-6E-73-73-68-2E-63-6F 6D-2C-75-6D-61-63-2D-31| enssh.com,umac-1
>0260 |32-38-2D-65-74-6D-40-6F 70-65-6E-73-73-68-2E-63| 28-etm@openssh.c
>0270 |6F-6D-2C-68-6D-61-63-2D 73-68-61-32-2D-32-35-36| om,hmac-sha2-256
>0280 |2D-65-74-6D-40-6F-70-65 6E-73-73-68-2E-63-6F-6D| -etm@openssh.com
>0290 |2C-68-6D-61-63-2D-73-68 61-32-2D-35-31-32-2D-65| ,hmac-sha2-512-e
>02A0 |74-6D-40-6F-70-65-6E-73 73-68-2E-63-6F-6D-2C-68| tm@openssh.com,h
>02B0 |6D-61-63-2D-72-69-70-65 6D-64-31-36-30-2D-65-74| mac-ripemd160-et
>02C0 |6D-40-6F-70-65-6E-73-73 68-2E-63-6F-6D-2C-68-6D| m@openssh.com,hm
>02D0 |61-63-2D-73-68-61-31-2D 39-36-2D-65-74-6D-40-6F| ac-sha1-96-etm@o
>02E0 |70-65-6E-73-73-68-2E-63 6F-6D-2C-68-6D-61-63-2D| penssh.com,hmac-
>02F0 |6D-64-35-2D-39-36-2D-65 74-6D-40-6F-70-65-6E-73| md5-96-etm@opens
>0300 |73-68-2E-63-6F-6D-2C-68 6D-61-63-2D-6D-64-35-2C| sh.com,hmac-md5,
>0310 |68-6D-61-63-2D-73-68-61 31-2C-75-6D-61-63-2D-36| hmac-sha1,umac-6
>0320 |34-40-6F-70-65-6E-73-73 68-2E-63-6F-6D-2C-75-6D| 4@openssh.com,um
>0330 |61-63-2D-31-32-38-40-6F 70-65-6E-73-73-68-2E-63| ac-128@openssh.c
>0340 |6F-6D-2C-68-6D-61-63-2D 72-69-70-65-6D-64-31-36| om,hmac-ripemd16
>0350 |30-2C-68-6D-61-63-2D-72 69-70-65-6D-64-31-36-30| 0,hmac-ripemd160
>0360 |40-6F-70-65-6E-73-73-68 2E-63-6F-6D-2C-68-6D-61| @openssh.com,hma
>0370 |63-2D-73-68-61-31-2D-39 36-2C-68-6D-61-63-2D-6D| c-sha1-96,hmac-m
>0380 |64-35-2D-39-36-00-00-01 76-68-6D-61-63-2D-6D-64| d5-96...vhmac-md
>0390 |35-2D-65-74-6D-40-6F-70 65-6E-73-73-68-2E-63-6F| 5-etm@openssh.co
>03A0 |6D-2C-68-6D-61-63-2D-73 68-61-31-2D-65-74-6D-40| m,hmac-sha1-etm@
>03B0 |6F-70-65-6E-73-73-68-2E 63-6F-6D-2C-75-6D-61-63| openssh.com,umac
>03C0 |2D-36-34-2D-65-74-6D-40 6F-70-65-6E-73-73-68-2E| -64-etm@openssh.
>03D0 |63-6F-6D-2C-75-6D-61-63 2D-31-32-38-2D-65-74-6D| com,umac-128-etm
>03E0 |40-6F-70-65-6E-73-73-68 2E-63-6F-6D-2C-68-6D-61| @openssh.com,hma
>03F0 |63-2D-73-68-61-32-2D-32 35-36-2D-65-74-6D-40-6F| c-sha2-256-etm@o
>0400 |70-65-6E-73-73-68-2E-63 6F-6D-2C-68-6D-61-63-2D| penssh.com,hmac-
>0410 |73-68-61-32-2D-35-31-32 2D-65-74-6D-40-6F-70-65| sha2-512-etm@ope
>0420 |6E-73-73-68-2E-63-6F-6D 2C-68-6D-61-63-2D-72-69| nssh.com,hmac-ri
>0430 |70-65-6D-64-31-36-30-2D 65-74-6D-40-6F-70-65-6E| pemd160-etm@open
>0440 |73-73-68-2E-63-6F-6D-2C 68-6D-61-63-2D-73-68-61| ssh.com,hmac-sha
>0450 |31-2D-39-36-2D-65-74-6D 40-6F-70-65-6E-73-73-68| 1-96-etm@openssh
>0460 |2E-63-6F-6D-2C-68-6D-61 63-2D-6D-64-35-2D-39-36| .com,hmac-md5-96
>0470 |2D-65-74-6D-40-6F-70-65 6E-73-73-68-2E-63-6F-6D| -etm@openssh.com
>0480 |2C-68-6D-61-63-2D-6D-64 35-2C-68-6D-61-63-2D-73| ,hmac-md5,hmac-s
>0490 |68-61-31-2C-75-6D-61-63 2D-36-34-40-6F-70-65-6E| ha1,umac-64@open
>04A0 |73-73-68-2E-63-6F-6D-2C 75-6D-61-63-2D-31-32-38| ssh.com,umac-128
>04B0 |40-6F-70-65-6E-73-73-68 2E-63-6F-6D-2C-68-6D-61| @openssh.com,hma
>04C0 |63-2D-72-69-70-65-6D-64 31-36-30-2C-68-6D-61-63| c-ripemd160,hmac
>04D0 |2D-72-69-70-65-6D-64-31 36-30-40-6F-70-65-6E-73| -ripemd160@opens
>04E0 |73-68-2E-63-6F-6D-2C-68 6D-61-63-2D-73-68-61-31| sh.com,hmac-sha1
>04F0 |2D-39-36-2C-68-6D-61-63 2D-6D-64-35-2D-39-36-00| -96,hmac-md5-96.
>0500 |00-00-15-6E-6F-6E-65-2C 7A-6C-69-62-40-6F-70-65| ...none,zlib@ope
>0510 |6E-73-73-68-2E-63-6F-6D 00-00-00-15-6E-6F-6E-65| nssh.com....none
>0520 |2C-7A-6C-69-62-40-6F-70 65-6E-73-73-68-2E-63-6F| ,zlib@openssh.co
>0530 |6D-00-00-00-00-00-00-00 00-00-00-00-00-00      | m.............
commented May 8 by mabayraktar (120 points)
2017 part2

>11:34:59.467 Verbose SSH: Sending packet SSH_MSG_KEXINIT (913 bytes).
>0000 |14-40-5E-50-C5-C6-F9-43 1B-6B-7D-7C-21-F9-43-64| .@^P...C.k}|!.Cd
>0010 |5B-00-00-00-D0-64-69-66 66-69-65-2D-68-65-6C-6C| [....diffie-hell
>0020 |6D-61-6E-2D-67-72-6F-75 70-2D-65-78-63-68-61-6E| man-group-exchan
>0030 |67-65-2D-73-68-61-32-35 36-2C-64-69-66-66-69-65| ge-sha256,diffie
>0040 |2D-68-65-6C-6C-6D-61-6E 2D-67-72-6F-75-70-31-34| -hellman-group14
>0050 |2D-73-68-61-32-35-36-2C 64-69-66-66-69-65-2D-68| -sha256,diffie-h
>0060 |65-6C-6C-6D-61-6E-2D-67 72-6F-75-70-31-35-2D-73| ellman-group15-s
>0070 |68-61-35-31-32-2C-64-69 66-66-69-65-2D-68-65-6C| ha512,diffie-hel
>0080 |6C-6D-61-6E-2D-67-72-6F 75-70-31-36-2D-73-68-61| lman-group16-sha
>0090 |35-31-32-2C-64-69-66-66 69-65-2D-68-65-6C-6C-6D| 512,diffie-hellm
>00A0 |61-6E-2D-67-72-6F-75-70 2D-65-78-63-68-61-6E-67| an-group-exchang
>00B0 |65-2D-73-68-61-31-2C-64 69-66-66-69-65-2D-68-65| e-sha1,diffie-he
>00C0 |6C-6C-6D-61-6E-2D-67-72 6F-75-70-31-34-2D-73-68| llman-group14-sh
>00D0 |61-31-2C-65-63-64-68-2D 73-68-61-32-2D-6E-69-73| a1,ecdh-sha2-nis
>00E0 |74-70-32-35-36-00-00-00 93-73-73-68-2D-64-73-73| tp256....ssh-dss
>00F0 |2C-72-73-61-2D-73-68-61 32-2D-32-35-36-2C-73-73| ,rsa-sha2-256,ss
>0100 |68-2D-72-73-61-2D-73-68 61-32-35-36-40-73-73-68| h-rsa-sha256@ssh
>0110 |2E-63-6F-6D-2C-72-73-61 2D-73-68-61-32-2D-35-31| .com,rsa-sha2-51
>0120 |32-2C-73-73-68-2D-72-73 61-2C-78-35-30-39-76-33| 2,ssh-rsa,x509v3
>0130 |2D-73-69-67-6E-2D-72-73 61-2D-73-68-61-32-35-36| -sign-rsa-sha256
>0140 |40-73-73-68-2E-63-6F-6D 2C-78-35-30-39-76-33-2D| @ssh.com,x509v3-
>0150 |73-69-67-6E-2D-72-73-61 2C-78-35-30-39-76-33-2D| sign-rsa,x509v3-
>0160 |73-69-67-6E-2D-64-73-73 2C-65-63-64-73-61-2D-73| sign-dss,ecdsa-s
>0170 |68-61-32-2D-6E-69-73-74 70-32-35-36-00-00-00-B9| ha2-nistp256....
>0180 |61-65-73-32-35-36-2D-63 74-72-2C-61-65-73-31-39| aes256-ctr,aes19
>0190 |32-2D-63-74-72-2C-61-65 73-31-32-38-2D-63-74-72| 2-ctr,aes128-ctr
>01A0 |2C-61-65-73-32-35-36-2D 63-62-63-2C-61-65-73-31| ,aes256-cbc,aes1
>01B0 |39-32-2D-63-62-63-2C-61 65-73-31-32-38-2D-63-62| 92-cbc,aes128-cb
>01C0 |63-2C-33-64-65-73-2D-63 74-72-2C-33-64-65-73-2D| c,3des-ctr,3des-
>01D0 |63-62-63-2C-74-77-6F-66 69-73-68-32-35-36-2D-63| cbc,twofish256-c
>01E0 |74-72-2C-74-77-6F-66-69 73-68-31-39-32-2D-63-74| tr,twofish192-ct
>01F0 |72-2C-74-77-6F-66-69-73 68-31-32-38-2D-63-74-72| r,twofish128-ctr
>0200 |2C-74-77-6F-66-69-73-68 32-35-36-2D-63-62-63-2C| ,twofish256-cbc,
>0210 |74-77-6F-66-69-73-68-31 39-32-2D-63-62-63-2C-74| twofish192-cbc,t
>0220 |77-6F-66-69-73-68-31-32 38-2D-63-62-63-2C-74-77| wofish128-cbc,tw
>0230 |6F-66-69-73-68-2D-63-62 63-00-00-00-B9-61-65-73| ofish-cbc....aes
>0240 |32-35-36-2D-63-74-72-2C 61-65-73-31-39-32-2D-63| 256-ctr,aes192-c
>0250 |74-72-2C-61-65-73-31-32 38-2D-63-74-72-2C-61-65| tr,aes128-ctr,ae
>0260 |73-32-35-36-2D-63-62-63 2C-61-65-73-31-39-32-2D| s256-cbc,aes192-
>0270 |63-62-63-2C-61-65-73-31 32-38-2D-63-62-63-2C-33| cbc,aes128-cbc,3
>0280 |64-65-73-2D-63-74-72-2C 33-64-65-73-2D-63-62-63| des-ctr,3des-cbc
>0290 |2C-74-77-6F-66-69-73-68 32-35-36-2D-63-74-72-2C| ,twofish256-ctr,
>02A0 |74-77-6F-66-69-73-68-31 39-32-2D-63-74-72-2C-74| twofish192-ctr,t
>02B0 |77-6F-66-69-73-68-31-32 38-2D-63-74-72-2C-74-77| wofish128-ctr,tw
>02C0 |6F-66-69-73-68-32-35-36 2D-63-62-63-2C-74-77-6F| ofish256-cbc,two
>02D0 |66-69-73-68-31-39-32-2D 63-62-63-2C-74-77-6F-66| fish192-cbc,twof
>02E0 |69-73-68-31-32-38-2D-63 62-63-2C-74-77-6F-66-69| ish128-cbc,twofi
>02F0 |73-68-2D-63-62-63-00-00 00-25-68-6D-61-63-2D-73| sh-cbc...%hmac-s
>0300 |68-61-32-2D-32-35-36-2C 68-6D-61-63-2D-73-68-61| ha2-256,hmac-sha
>0310 |32-2D-35-31-32-2C-68-6D 61-63-2D-73-68-61-31-00| 2-512,hmac-sha1.
>0320 |00-00-25-68-6D-61-63-2D 73-68-61-32-2D-32-35-36| ..%hmac-sha2-256
>0330 |2C-68-6D-61-63-2D-73-68 61-32-2D-35-31-32-2C-68| ,hmac-sha2-512,h
>0340 |6D-61-63-2D-73-68-61-31 00-00-00-1A-6E-6F-6E-65| mac-sha1....none
>0350 |2C-7A-6C-69-62-2C-7A-6C 69-62-40-6F-70-65-6E-73| ,zlib,zlib@opens
>0360 |73-68-2E-63-6F-6D-00-00 00-1A-6E-6F-6E-65-2C-7A| sh.com....none,z
>0370 |6C-69-62-2C-7A-6C-69-62 40-6F-70-65-6E-73-73-68| lib,zlib@openssh
>0380 |2E-63-6F-6D-00-00-00-00 00-00-00-00-00-00-00-00| .com............
>0390 |00                                             | .
>11:34:59.530 Debug SSH: Group exchange.
>11:34:59.545 Verbose SSH: Sending packet SSH_MSG_KEX_DH_GEX_REQUEST (13 bytes).
>0000 |22-00-00-04-00-00-00-08 00-00-00-10-00         | "............
>11:34:59.639 Verbose SSH: Received packet SSH_MSG_KEX_31 (267 bytes).
>0000 |1F-00-00-01-01-00-DD-20 47-CB-DB-B6-F8-E9-19-BC| ....... G.......
>0010 |63-DE-88-5B-34-D0-FD-6E 3D-B2-88-7D-8B-46-FE-24| c..[4..n=..}.F.$
>0020 |98-86-AC-ED-6B-46-DF-CD 55-53-16-81-85-FD-37-61| ....kF..US....7a
>0030 |22-17-1C-D8-92-7E-60-12 0F-A8-D0-1F-01-D0-3E-58| "....~`.......>X
>0040 |28-1F-EA-9A-1A-BE-97-63 1C-82-8E-41-81-5F-34-FD| (......c...A._4.
>0050 |CD-F7-87-41-9F-E1-3A-31 37-64-9A-A9-3D-25-84-23| ...A..:17d..=%.#
>0060 |0D-F5-F2-4B-5C-00-C8-8B 7D-7D-E4-36-76-93-42-8C| ...K\...}}.6v.B.
>0070 |73-03-76-F2-18-A5-3E-85 3B-08-51-BA-B7-C5-3C-15| s.v...>.;.Q...<.
>0080 |DA-78-39-CB-E1-28-5D-B6 3F-6F-A4-5C-1B-B5-9F-E1| .x9..(].?o.\....
>0090 |C5-BB-91-8F-0F-84-59-D7 EF-60-AC-FF-5C-0F-A0-F3| ......Y..`..\...
>00A0 |FC-AD-1C-5F-4C-E4-41-6D 4F-4B-36-B0-5C-DC-EB-E4| ..._L.AmOK6.\...
>00B0 |FB-87-9E-95-84-7E-FB-C6 44-9C-D1-90-24-88-43-BC| .....~..D...$.C.
>00C0 |7E-DB-14-5F-BF-C4-ED-BB 1A-3C-95-92-98-F0-8F-3B| ~.._.....<.....;
>00D0 |A2-CF-BE-23-1B-BE-20-4B E6-F9-06-20-9D-28-BD-48| ...#.. K... .(.H
>00E0 |20-AB-3E-7B-E9-6C-26-AE 8A-80-9A-DD-8D-1A-5A-0B|  .>{.l&.......Z.
>00F0 |00-8E-95-70-FA-4C-46-97 E1-16-B8-11-98-92-C6-04| ...p.LF.........
>0100 |29-36-84-4F-AB-5B-00-00 00-01-02               | )6.O.[.....
>11:34:59.655 Debug SSH: Negotiating key.
>11:34:59.702 Debug SSH: Received 2048-bit Diffie-Hellman prime (minimum allowed size is 1024 bits).
>11:34:59.717 Verbose SSH: Sending packet SSH_MSG_KEX_DH_GEX_INIT (262 bytes).
>0000 |20-00-00-01-01-00-AB-78 C3-78-98-23-CB-34-B6-ED|  ......x.x.#.4..
>0010 |8B-6D-2C-35-B3-8B-80-8E A8-0D-69-47-F2-97-23-1A| .m,5......iG..#.
>0020 |48-F7-49-4C-AD-5E-88-FF FC-1C-0E-9B-EB-26-CA-96| H.IL.^.......&..
>0030 |0E-72-D5-42-81-08-CC-D4 A9-7B-1B-1C-0F-EC-79-FA| .r.B.....{....y.
>0040 |1C-F0-0F-2D-A4-73-50-5A CE-1A-EB-07-99-09-AA-00| ...-.sPZ........
>0050 |66-FE-E0-F6-7C-F2-1D-0B 3A-A3-86-8D-1A-C4-17-E3| f...|...:.......
>0060 |B7-46-02-8B-A1-E5-78-B1 9F-E0-E7-81-25-C0-2A-D1| .F....x.....%.*.
>0070 |F0-02-D7-51-C3-C3-F2-04 6C-ED-21-32-2B-E5-64-A2| ...Q....l.!2+.d.
>0080 |2C-60-7B-8D-9D-2D-A1-D7 BA-14-92-59-4C-7F-69-20| ,`{..-.....YL.i
> 0090 |E3-68-A4-F8-B7-2E-CD-14 58-AA-A8-B8-7A-A3-F2-B7| .h......X...z...
>00A0 |63-3C-34-72-00-38-84-D5 64-79-DA-8F-86-40-A4-AC| c<4r.8..dy...@..
>00B0 |22-BF-1C-50-4F-F5-E4-80 2F-A5-E1-58-F6-96-4E-6E| "..PO.../..X..Nn
>00C0 |7E-43-4C-01-14-E0-36-51 A4-4A-5C-BC-11-98-C8-C4| ~CL...6Q.J\.....
>00D0 |81-E4-91-A6-58-F7-5A-B5 C0-D7-28-06-13-C9-94-02| ....X.Z...(.....
>00E0 |EB-3C-E5-9A-5E-CA-35-F2 6E-E9-BB-3F-BB-5C-3A-E3| .<..^.5.n..?.\:.
>00F0 |C8-81-A9-FA-52-0F-58-55 30-B9-27-30-E6-17-48-D1| ....R.XU0.'0..H.
>0100 |08-B5-F8-3F-0B-DC
commented May 8 by mabayraktar (120 points)
2017R1 part 3

>11:34:59.905 Verbose SSH: Received packet SSH_MSG_KEX_DH_GEX_REPLY (758 bytes).
>0000 |21-00-00-01-B1-00-00-00 07-73-73-68-2D-64-73-73| !........ssh-dss
>0010 |00-00-00-81-00-C3-55-FF 5E-45-62-88-5A-BE-7F-4D| ......U.^Eb.Z..M
>0020 |4F-34-DB-F3-B7-55-FC-52 7F-09-1B-DD-D9-E0-5F-2D| O4...U.R......_-
>0030 |99-8C-A3-F5-57-0F-E3-6C 45-FA-13-17-22-DB-56-A8| ....W..lE...".V.
>0040 |52-68-FB-BA-06-37-4E-21 05-44-09-4C-CD-A7-5F-6A| Rh...7N!.D.L.._j
>0050 |9D-30-A3-3C-00-05-D3-32 E0-C0-F0-ED-65-96-2F-C9| .0.<...2....e./.
>0060 |80-E0-6D-7C-82-A3-EA-A5 9D-3E-41-61-5F-40-63-35| ..m|.....>Aa_@c5
>0070 |EC-ED-A2-47-0E-65-AB-93 2F-20-C7-B4-2F-8E-82-9A| ...G.e../ ../...
>0080 |27-44-3F-3F-FE-C3-AA-A6 47-EB-5F-77-18-EC-E2-6D| 'D??....G._w...m
>0090 |93-FD-14-A6-5B-00-00-00 15-00-D9-F0-D6-C8-78-E2| ....[.........x.
>00A0 |8F-02-B0-D8-48-47-71-61 D5-89-BD-07-68-D7-00-00| ....HGqa....h...
>00B0 |00-80-5B-A3-36-DF-AA-26 6D-DD-17-8D-A0-74-9B-7C| ..[.6..&m....t.|
>00C0 |A9-AA-27-07-20-65-D3-A3 EE-FB-BE-4E-DC-B8-6D-7A| ..'. e.....N..mz
>00D0 |41-3F-05-9A-DF-76-7A-2F 0D-C8-76-33-45-DC-56-5E| A?...vz/..v3E.V^
>00E0 |C7-E8-A5-07-C9-32-60-09 14-09-6C-5C-D6-D4-FD-3E| .....2`...l\...>
>00F0 |B7-5A-6E-09-CC-42-72-D0 4F-20-D4-90-12-A8-00-EE| .Zn..Br.O ......
>0100 |E4-92-2D-63-AF-9F-4A-8D 4B-C9-CF-87-2C-FC-12-20| ..-c..J.K...,..
> 0110 |F1-BC-DB-24-51-DE-74-3E BF-AF-41-AB-5B-8F-5E-F7| ...$Q.t>..A.[.^.
>0120 |13-E7-80-EF-D5-E4-D3-EE 36-E1-99-64-AF-1A-81-D6| ........6..d....
>0130 |C3-20-00-00-00-80-0E-EA B0-BF-7B-80-B1-73-6A-BC| . ........{..sj.
>0140 |36-69-8F-CF-FA-35-3C-F0 BE-85-34-0F-00-E1-FA-15| 6i...5<...4.....
>0150 |3B-40-CD-23-D7-8A-9E-A1 EE-DC-32-4B-08-4B-1A-81| ;@.#......2K.K..
>0160 |71-6D-BA-9E-AC-77-6B-32 0B-A5-14-5D-C9-3E-33-4C| qm...wk2...].>3L
>0170 |A3-39-E8-5C-98-3F-EB-5A 39-46-C9-D0-70-9B-F2-93| .9.\.?.Z9F..p...
>0180 |85-79-C4-E5-97-CF-F6-2D 3F-40-CC-34-98-B6-18-F2| .y.....-?@.4....
>0190 |FF-E3-39-1E-DA-0A-B1-06 80-3F-D2-CD-9E-8F-5D-7C| ..9......?....]|
>01A0 |98-67-A5-61-AF-D0-30-D9 F9-57-1D-56-AE-EA-43-B1| .g.a..0..W.V..C.
>01B0 |22-7D-C8-D3-F1-A5-00-00 01-01-00-B9-FC-BF-EA-60| "}.............`
>01C0 |B1-B6-3A-00-14-F8-74-22 CE-2D-5B-FD-D7-B1-AD-72| ..:...t".-[....r
>01D0 |94-D5-4A-63-37-23-F5-95 38-EE-D1-E6-75-EF-CF-64| ..Jc7#..8...u..d
>01E0 |60-AA-A1-1B-99-D5-F1-BD C8-93-B1-61-43-D3-5D-53| `..........aC.]S
>01F0 |BE-15-8E-BF-7B-25-DB-3A 6C-84-5D-F3-74-2F-3C-87| ....{%.:l.].t/<.
>0200 |27-8C-2A-04-65-13-05-10 AA-77-63-7A-32-F8-86-AA| '.*.e....wcz2...
>0210 |08-D0-C1-CB-51-20-5E-DE 3E-D6-3A-D8-AD-52-2F-48| ....Q ^.>.:..R/H
>0220 |36-5A-F6-97-E5-C9-DB-F5 23-41-65-EC-EC-E0-1B-16| 6Z......#Ae.....
>0230 |66-46-21-C7-01-68-58-36 3F-BF-4F-07-5F-88-12-7A| fF!..hX6?.O._..z
>0240 |72-38-29-BC-29-62-F5-FD A9-2D-EE-16-FF-6C-E9-80| r8).)b...-...l..
>0250 |18-3F-AA-62-1C-73-9D-53 6D-6E-59-CD-73-AD-29-A8| .?.b.s.SmnY.s.).
>0260 |EE-DD-90-9E-62-F2-6B-A3 8A-1C-8F-AF-83-6F-BA-B2| ....b.k......o..
>0270 |8F-5E-A2-20-E7-96-3F-6F D3-AE-15-92-D2-C0-98-D3| .^. ..?o........
>0280 |E2-0D-3C-E3-3E-0F-2A-09 FB-0B-8F-66-6A-87-76-CA| ..<.>.*....fj.v.
>0290 |FF-08-1B-45-D7-91-9D-9B 28-8F-D7-8D-08-6E-4F-22| ...E....(....nO"
>02A0 |C6-43-A0-F2-BB-8C-54-26 62-2A-42-2B-FB-F7-AD-61| .C....T&b*B+...a
>02B0 |2D-20-E9-C6-7B-61-CF-BA 5F-E1-27-00-00-00-37-00| - ..{a.._.'...7.
>02C0 |00-00-07-73-73-68-2D-64 73-73-00-00-00-28-76-B7| ...ssh-dss...(v.
>02D0 |4F-01-31-FB-1F-94-B2-76 2F-45-0B-4C-11-C6-08-C5| O.1....v/E.L....
>02E0 |30-D0-61-9A-20-71-E0-AA F0-52-DE-5D-D4-4E-2D-1B| 0.a. q...R.].N-.
>02F0 |C6-85-98-64-8B-61                              | ...d.a
>11:34:59.920 Verbose SSH: Received packet SSH_MSG_NEWKEYS (1 bytes).
>0000 |15                                             | .
>11:34:59.983 Debug SSH: Validating signature.
>11:35:00.061 Verbose SSH: Sending packet SSH_MSG_NEWKEYS (1 bytes).
>0000 |15                                             | .
>11:35:00.092 Info SSH: Negotiation finished.
commented May 9 by Lukas Matyska (54,110 points)
Thank you for the log. I have noticed, that in version 2017r1, you did not use the diffie-hellman-group1-sha1. It corresponds to this setting:

par.KeyExchangeAlgorithms = par.KeyExchangeAlgorithms Or SshKeyExchangeAlgorithm.DiffieHellmanGroup1SHA1

There are other differences, we will look at those.

In the mean time, can you please disable adding DiffieHellmanGroup1SHA1 in the newer version (2018r2 or 2019r1). Just comment out the mentioned line for setting the par.KeyExchangeAlgorithms.
It is possible that the server has some issue with this legacy algorithm.
0 votes
answered May 13 by Lukas Matyska (54,110 points)

I have compared the logs produced by old version and new version.
The offered algorithms differ a little. It seems that this caused the issue with your server. Can you please try to enable the exactly same algorithms and use it with the new version?

It can be done like this:

Dim thisSFTP = New Rebex.Net.Sftp

Dim par = thisSFTP.Settings.SshParameters
par.SetKeyExchangeAlgorithms("diffie-hellman-group-exchange-sha256",
                                "diffie-hellman-group14-sha256",
                                "diffie-hellman-group15-sha512",
                                "diffie-hellman-group16-sha512",
                                "diffie-hellman-group-exchange-sha1",
                                "diffie-hellman-group14-sha1",
                                "ecdh-sha2-nistp256")
par.SetHostKeyAlgorithms("ssh-dss",
                            "rsa-sha2-256",
                            "ssh-rsa-sha256@ssh.com",
                            "rsa-sha2-512",
                            "ssh-rsa",
                            "x509v3-sign-rsa-sha256@ssh.com",
                            "x509v3-sign-rsa",
                            "x509v3-sign-dss",
                            "ecdsa-sha2-nistp256")
par.SetEncryptionAlgorithms("aes256-ctr",
                                "aes192-ctr",
                                "aes128-ctr",
                                "aes256-cbc",
                                "aes192-cbc",
                                "aes128-cbc",
                                "3des-ctr",
                                "3des-cbc",
                                "twofish256-ctr",
                                "twofish192-ctr",
                                "twofish128-ctr",
                                "twofish256-cbc",
                                "twofish192-cbc",
                                "twofish128-cbc",
                                "twofish-cbc")
par.SetMacAlgorithms("hmac-sha2-256",
                    "hmac-sha2-512",
                    "hmac-sha1")

thisSFTP.LogWriter = new Rebex.FileLogWriter(FtpDebugFile, Rebex.LogLevel.Debug)
thisSFTP.Connect(Instance.remoteHost, Instance.remoteHostPort)

Please let us know, whether using this settings, you are able to connect to your server.

...