0 votes
by (360 points)

How do i prevent this error message on Rebex.Net.Sftp.Connect

Errormessage: Could not use server's key. Please contact server administrator to generate new key

Log:

2018-10-24 14:07:07.328 Opening log file. 2018-10-24 14:07:07.329
Using FileLogWriter version 2.0.5885.0. 2018-10-24 14:07:07.344 INFO
Sftp(1)[1] Info: Connecting to ftpshop.soennecken.de:22 using Sftp
3.0.5885.0. 2018-10-24 14:07:07.521 VERBOSE Sftp(1)[1] 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-35-38-38 35-2E-30-0D-0A
| 3.0.5885.0.. 2018-10-24 14:07:07.561 VERBOSE Sftp(1)[1] SSH:
Received data: 0000 |53-53-48-2D-32-2E-30-2D 50-53-46-54-50-64-2E-20|
SSH-2.0-PSFTPd. 0010 |53-65-63-75-72-65-20-46
54-50-20-53-65-72-76-65| Secure FTP Serve 0020
|72-20-72-65-61-64-79-0D 0A | r ready.. 2018-10-24
14:07:07.562 DEBUG Sftp(1)[1] SSH: Server is 'SSH-2.0-PSFTPd. Secure
FTP Server ready'. 2018-10-24 14:07:07.577 INFO Sftp(1)[1] SSH:
Negotiation started. 2018-10-24 14:07:07.614 VERBOSE Sftp(1)[1] SSH:
Sending packet SSH
MSG_KEXINIT (879 bytes). 0000
|14-CA-F5-A1-10-A8-AB-47 92-C2-57-68-DC-F2-5E-ED| .......G..Wh..^.
0010 |1D-00-00-00-7E-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-2D-65|
-hellman-group-e 0050 |78-63-68-61-6E-67-65-2D 73-68-61-31-2C-64-69-66| xchange-sha1,dif 0060
|66-69-65-2D-68-65-6C-6C 6D-61-6E-2D-67-72-6F-75| fie-hellman-grou
0070 |70-31-34-2D-73-68-61-31 2C-64-69-66-66-69-65-2D|
p14-sha1,diffie- 0080 |68-65-6C-6C-6D-61-6E-2D
67-72-6F-75-70-31-2D-73| hellman-group1-s 0090
|68-61-31-00-00-00-1F-73 73-68-2D-64-73-73-2C-73| ha1....ssh-dss,s
00A0 |73-68-2D-72-73-61-2C-78 35-30-39-76-33-2D-73-69|
sh-rsa,x509v3-si 00B0 |67-6E-2D-72-73-61-00-00
00-E9-61-65-73-32-35-36| gn-rsa....aes256 00C0
|2D-63-74-72-2C-61-65-73 31-39-32-2D-63-74-72-2C| -ctr,aes192-ctr,
00D0 |61-65-73-31-32-38-2D-63 74-72-2C-61-65-73-32-35|
aes128-ctr,aes25 00E0 |36-2D-63-62-63-2C-61-65
73-31-39-32-2D-63-62-63| 6-cbc,aes192-cbc 00F0
|2C-61-65-73-31-32-38-2D 63-62-63-2C-33-64-65-73| ,aes128-cbc,3des
0100 |2D-63-74-72-2C-33-64-65 73-2D-63-62-63-2C-74-77|
-ctr,3des-cbc,tw 0110 |6F-66-69-73-68-32-35-36 2D-63-74-72-2C-74-77-6F| ofish256-ctr,two 0120
|66-69-73-68-31-39-32-2D 63-74-72-2C-74-77-6F-66| fish192-ctr,twof
0130 |69-73-68-31-32-38-2D-63 74-72-2C-74-77-6F-66-69|
ish128-ctr,twofi 0140 |73-68-32-35-36-2D-63-62
63-2C-74-77-6F-66-69-73| sh256-cbc,twofis 0150
|68-31-39-32-2D-63-62-63 2C-74-77-6F-66-69-73-68| h192-cbc,twofish
0160 |31-32-38-2D-63-62-63-2C 74-77-6F-66-69-73-68-2D|
128-cbc,twofish- 0170 |63-62-63-2C-62-6C-6F-77
66-69-73-68-2D-63-74-72| cbc,blowfish-ctr 0180
|2C-62-6C-6F-77-66-69-73 68-2D-63-62-63-2C-61-72| ,blowfish-cbc,ar
0190 |63-66-6F-75-72-32-35-36 2C-61-72-63-66-6F-75-72|
cfour256,arcfour 01A0 |31-32-38-00-00-00-E9-61
65-73-32-35-36-2D-63-74| 128....aes256-ct 01B0
|72-2C-61-65-73-31-39-32 2D-63-74-72-2C-61-65-73| r,aes192-ctr,aes
01C0 |31-32-38-2D-63-74-72-2C 61-65-73-32-35-36-2D-63|
128-ctr,aes256-c 01D0 |62-63-2C-61-65-73-31-39
32-2D-63-62-63-2C-61-65| bc,aes192-cbc,ae 01E0
|73-31-32-38-2D-63-62-63 2C-33-64-65-73-2D-63-74| s128-cbc,3des-ct
01F0 |72-2C-33-64-65-73-2D-63 62-63-2C-74-77-6F-66-69|
r,3des-cbc,twofi 0200 |73-68-32-35-36-2D-63-74
72-2C-74-77-6F-66-69-73| sh256-ctr,twofis 0210
|68-31-39-32-2D-63-74-72 2C-74-77-6F-66-69-73-68| h192-ctr,twofish
0220 |31-32-38-2D-63-74-72-2C 74-77-6F-66-69-73-68-32|
128-ctr,twofish2 0230 |35-36-2D-63-62-63-2C-74
77-6F-66-69-73-68-31-39| 56-cbc,twofish19 0240
|32-2D-63-62-63-2C-74-77 6F-66-69-73-68-31-32-38| 2-cbc,twofish128
0250 |2D-63-62-63-2C-74-77-6F 66-69-73-68-2D-63-62-63|
-cbc,twofish-cbc 0260 |2C-62-6C-6F-77-66-69-73 68-2D-63-74-72-2C-62-6C| ,blowfish-ctr,bl 0270
|6F-77-66-69-73-68-2D-63 62-63-2C-61-72-63-66-6F| owfish-cbc,arcfo
0280 |75-72-32-35-36-2C-61-72 63-66-6F-75-72-31-32-38|
ur256,arcfour128 0290 |00-00-00-47-68-6D-61-63
2D-73-68-61-32-2D-32-35| ...Ghmac-sha2-25 02A0
|36-2C-68-6D-61-63-2D-73 68-61-32-2D-35-31-32-2C| 6,hmac-sha2-512,
02B0 |68-6D-61-63-2D-73-68-61 31-2C-68-6D-61-63-2D-6D|
hmac-sha1,hmac-m 02C0 |64-35-2C-68-6D-61-63-2D
73-68-61-31-2D-39-36-2C| d5,hmac-sha1-96, 02D0
|68-6D-61-63-2D-6D-64-35 2D-39-36-00-00-00-47-68| hmac-md5-96...Gh
02E0 |6D-61-63-2D-73-68-61-32 2D-32-35-36-2C-68-6D-61|
mac-sha2-256,hma 02F0 |63-2D-73-68-61-32-2D-35
31-32-2C-68-6D-61-63-2D| c-sha2-512,hmac- 0300
|73-68-61-31-2C-68-6D-61 63-2D-6D-64-35-2C-68-6D| sha1,hmac-md5,hm
0310 |61-63-2D-73-68-61-31-2D 39-36-2C-68-6D-61-63-2D|
ac-sha1-96,hmac- 0320 |6D-64-35-2D-39-36-00-00
00-1A-6E-6F-6E-65-2C-7A| md5-96....none,z 0330
|6C-69-62-2C-7A-6C-69-62 40-6F-70-65-6E-73-73-68| lib,zlib@openssh
0340 |2E-63-6F-6D-00-00-00-1A 6E-6F-6E-65-2C-7A-6C-69|
.com....none,zli 0350 |62-2C-7A-6C-69-62-40-6F
70-65-6E-73-73-68-2E-63| b,zlib@openssh.c 0360
|6F-6D-00-00-00-00-00-00 00-00-00-00-00-00-00 | om.............
2018-10-24 14:07:07.667 VERBOSE Sftp(1)[16] SSH: Received packet

Applies to: Rebex SFTP

3 Answers

0 votes
by (360 points)

the debug Log is to big so this is the Second part:

SSHMSGKEXINIT (714 bytes). 0000 |14-9F-7B-29-0B-90-B1-AD
4D-A3-2E-55-37-7E-10-9A| ..{)....M..U7~.. 0010
|F1-00-00-00-B7-65-63-64 68-2D-73-68-61-32-2D-6E| .....ecdh-sha2-n
0020 |69-73-74-70-32-35-36-2C 65-63-64-68-2D-73-68-61|
istp256,ecdh-sha 0030 |32-2D-6E-69-73-74-70-33
38-34-2C-65-63-64-68-2D| 2-nistp384,ecdh- 0040
|73-68-61-32-2D-6E-69-73 74-70-35-32-31-2C-64-69| sha2-nistp521,di
0050 |66-66-69-65-2D-68-65-6C 6C-6D-61-6E-2D-67-72-6F|
ffie-hellman-gro 0060 |75-70-2D-65-78-63-68-61
6E-67-65-2D-73-68-61-32| up-exchange-sha2 0070
|35-36-2C-64-69-66-66-69 65-2D-68-65-6C-6C-6D-61| 56,diffie-hellma
0080 |6E-2D-67-72-6F-75-70-2D 65-78-63-68-61-6E-67-65|
n-group-exchange 0090 |2D-73-68-61-31-2C-64-69
66-66-69-65-2D-68-65-6C| -sha1,diffie-hel 00A0
|6C-6D-61-6E-2D-67-72-6F 75-70-31-2D-73-68-61-31| lman-group1-sha1
00B0 |2C-64-69-66-66-69-65-2D 68-65-6C-6C-6D-61-6E-2D|
,diffie-hellman- 00C0 |67-72-6F-75-70-31-34-2D
73-68-61-31-00-00-00-07| group14-sha1.... 00D0
|73-73-68-2D-72-73-61-00 00-00-A3-61-65-73-31-32| ssh-rsa....aes12
00E0 |38-2D-63-62-63-2C-61-65 73-31-32-38-2D-63-74-72|
8-cbc,aes128-ctr 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-61 65-73-31-39-32-2D-63-62| sh-cbc,aes192-cb
0110 |63-2C-61-65-73-31-39-32 2D-63-74-72-2C-61-65-73|
c,aes192-ctr,aes 0120 |32-35-36-2D-63-62-63-2C
61-65-73-32-35-36-2D-63| 256-cbc,aes256-c 0130
|74-72-2C-72-69-6A-6E-64 61-65-6C-31-32-38-2D-63| tr,rijndael128-c
0140 |62-63-2C-72-69-6A-6E-64 61-65-6C-31-39-32-2D-63|
bc,rijndael192-c 0150 |62-63-2C-72-69-6A-6E-64
61-65-6C-32-35-36-2D-63| bc,rijndael256-c 0160
|62-63-2C-72-69-6A-6E-64 61-65-6C-2D-63-62-63-40| bc,rijndael-cbc@
0170 |6C-79-73-61-74-6F-72-2E 6C-69-75-2E-73-65-00-00|
lysator.liu.se.. 0180 |00-A3-61-65-73-31-32-38
2D-63-62-63-2C-61-65-73| ..aes128-cbc,aes 0190
|31-32-38-2D-63-74-72-2C 33-64-65-73-2D-63-62-63| 128-ctr,3des-cbc
01A0 |2C-62-6C-6F-77-66-69-73 68-2D-63-62-63-2C-61-65|
,blowfish-cbc,ae 01B0 |73-31-39-32-2D-63-62-63
2C-61-65-73-31-39-32-2D| s192-cbc,aes192- 01C0
|63-74-72-2C-61-65-73-32 35-36-2D-63-62-63-2C-61| ctr,aes256-cbc,a
01D0 |65-73-32-35-36-2D-63-74 72-2C-72-69-6A-6E-64-61|
es256-ctr,rijnda 01E0 |65-6C-31-32-38-2D-63-62
63-2C-72-69-6A-6E-64-61| el128-cbc,rijnda 01F0
|65-6C-31-39-32-2D-63-62 63-2C-72-69-6A-6E-64-61| el192-cbc,rijnda
0200 |65-6C-32-35-36-2D-63-62 63-2C-72-69-6A-6E-64-61|
el256-cbc,rijnda 0210 |65-6C-2D-63-62-63-40-6C
79-73-61-74-6F-72-2E-6C| el-cbc@lysator.l 0220
|69-75-2E-73-65-00-00-00 3B-68-6D-61-63-2D-73-68| iu.se...;hmac-sh
0230 |61-32-2D-32-35-36-2C-68 6D-61-63-2D-73-68-61-32|
a2-256,hmac-sha2 0240 |2D-35-31-32-2C-68-6D-61
63-2D-73-68-61-31-2C-68| -512,hmac-sha1,h 0250
|6D-61-63-2D-73-68-61-31 2D-39-36-2C-68-6D-61-63| mac-sha1-96,hmac
0260 |2D-6D-64-35-00-00-00-3B 68-6D-61-63-2D-73-68-61|
-md5...;hmac-sha 0270 |32-2D-32-35-36-2C-68-6D 61-63-2D-73-68-61-32-2D| 2-256,hmac-sha2- 0280
|35-31-32-2C-68-6D-61-63 2D-73-68-61-31-2C-68-6D| 512,hmac-sha1,hm
0290 |61-63-2D-73-68-61-31-2D 39-36-2C-68-6D-61-63-2D|
ac-sha1-96,hmac- 02A0 |6D-64-35-00-00-00-09-7A
6C-69-62-2C-6E-6F-6E-65| md5....zlib,none 02B0
|00-00-00-09-7A-6C-69-62 2C-6E-6F-6E-65-00-00-00| ....zlib,none...
02C0 |00-00-00-00-00-00-00-00 00-00 | ..........
2018-10-24 14:07:07.703 DEBUG Sftp(1)[1] SSH: Group exchange.
2018-10-24 14:07:07.703 VERBOSE Sftp(1)[1] SSH: Sending packet
SSHMSGKEX30 (5 bytes). 0000 |1E-00-00-04-00
| ..... 2018-10-24 14:07:07.757 VERBOSE Sftp(1)[16] SSH: Received
packet SSH
MSGDISCONNECT (97 bytes). 0000 |01-00-00-00-09-00-00-00
54-43-6F-75-6C-64-20-6E| ........TCould n 0010
|6F-74-20-75-73-65-20-73 65-72-76-65-72-27-73-20| ot use server's
0020 |6B-65-79-2E-20-50-6C-65 61-73-65-20-63-6F-6E-74| key. Please
cont 0030 |61-63-74-20-73-65-72-76 65-72-20-61-64-6D-69-6E| act
server admin 0040 |69-73-74-72-61-74-6F-72 20-74-6F-20-67-65-6E-65|
istrator to gene 0050 |72-61-74-65-20-6E-65-77
20-6B-65-79-2E-00-00-00| rate new key.... 0060 |00
| . 2018-10-24 14:07:07.757 INFO Sftp(1)[16] SSH: Disconnected by the
server ('Could not use server's key. Please contact server
administrator to generate new key'). 2018-10-24 14:07:07.759 VERBOSE
Sftp(1)[16] SSH: Sending packet SSH
MSG_DISCONNECT (27 bytes). 0000
|01-00-00-00-0B-00-00-00 0E-53-65-73-73-69-6F-6E| .........Session
0010 |20-63-6C-6F-73-65-64-00 00-00-00 | closed....
2018-10-24 14:07:07.769 ERROR Sftp(1)[1] SSH: Negotiation failed.
Disconnected by the server ('Could not use server's key. Please
contact server administrator to generate new key'). 2018-10-24
14:07:07.782 ERROR Sftp(1)[1] Info: Rebex.Net.SshException:
Negotiation failed. Disconnected by the server ('Could not use
server's key. Please contact server administrator to generate new
key'). ---> Rebex.Net.SshException: Disconnected by the server ('Could
not use server's key. Please contact server administrator to generate
new key'). bei Rebex.Net.SshSession.HPY[Z,D](UNX2 Z, Int32 D, VNX J, D C, Z I, Z W) bei Rebex.Net.SshSession.HPY[Z,D](UNX2 Z, D D)
bei Rebex.Net.SshSession.WPY(MNX Z) bei Rebex.Net.QNX.C(SshSession
Z, Byte[] D, Byte[] J, Byte[] C, Byte[] I, Byte[]& W, Byte[]& L,
SshPublicKey& B) bei Rebex.Net.SshSession.MPY(Byte[] Z) --- Ende
der internen Ausnahmestapelüberwachung --- bei
Rebex.Net.SshSession.MPY(Byte[] Z) bei
Rebex.Net.SshSession.Negotiate() bei Rebex.Net.Sftp.RYF.MPY(IYF Z)
bei Rebex.Net.Sftp.RW(String Z, Int32 D, SshParameters J, IYF C)

0 votes
by (144k points)

Please upgrade to Rebex Total Pack 2016 R3 or higher (or Rebex SFTP 2016 R3 or higher) to solve this issue.

Despite the misleading error message (the strange part about genereting a new key actually came from the server), this is most likely caused by an incompatibility in Diffie-Hellman group exchange.

0 votes
by (360 points)
edited by

Okay, Rebex 2016 R3 did work, so I could get connected to the server, but now the login failes. The Login Data is correct, if I try the same login information with FileZilla for example it works.
So I thought maybe another compability issue and I tried the 2018 R2.1, but it did not work.

Got also a log:
https://dropmefiles.com/HHwc1

Code Sample:

    Dim ftp = New Rebex.Net.Sftp
    ftp.Timeout = 300000
    ftp.Settings.UseLargeBuffers = True
    ftp.Connect(serverName:=ftpServer, serverPort:=ftpPort)
    ftp.Login(userName:=ftpUserId, password:=ftpPassword)
by (144k points)
As far as I know, FileZilla is unable to create any usable log to make it possible to determine what it does differently. Would it be possible to try this with WinSCP? If it works, please create a log and mail it to us for analysis.
...