Key Exchange Failed

0 votes
asked Feb 16, 2012 by mikeheyda (120 points)
edited Feb 17, 2012

Why am I getting a a key exchange failed message. I've looked at the other topics with similar issues but none seems to match the error I'm getting. It doesn't seem to include any other information as to why it would be failing.

2012-02-16 16:30:19.724 Opening log file. 2012-02-16 16:30:20.314 INFO

Sftp(1) Info: Connecting to 10.202.5.57:22 using Sftp 2.0.4086.0 (trial version). 2012-02-16 16:30:20.460 DEBUG Sftp(1) SSH: Server is 'SSH-2.0-WeOnlyDo 2.1.3'. 2012-02-16 16:30:20.461 INFO Sftp(1) SSH: Negotiation started. 2012-02-16 16:30:20.488 VERBOSE Sftp(1) SSH: Sending packet SSH_MSG_KEXINIT (692 bytes). 14-66-14-E0-93-6C-5C-DE-7C-45-82-10-09-D0-DB-CA-23-00-00-00-59-64-69-66 66-69-65-2D-68-65-6C-6C-6D-61-6E-2D-67-72-6F-75-70-2D-65-78-63-68-61-6E 67-65-2D-73-68-61-31-2C-64-69-66-66-69-65-2D-68-65-6C-6C-6D-61-6E-2D-67 72-6F-75-70-31-34-2D-73-68-61-31-2C-64-69-66-66-69-65-2D-68-65-6C-6C-6D 61-6E-2D-67-72-6F-75-70-31-2D-73-68-61-31-00-00-00-0F-73-73-68-2D-64-73 73-2C-73-73-68-2D-72-73-61-00-00-00-F1-61-65-73-32-35-36-2D-63-74-72-2C 61-65-73-31-39-32-2D-63-74-72-2C-61-65-73-31-32-38-2D-63-74-72-2C-61-65 73-32-35-36-2D-63-62-63-2C-61-65-73-31-39-32-2D-63-62-63-2C-61-65-73-31 32-38-2D-63-62-63-2C-33-64-65-73-2D-63-74-72-2C-33-64-65-73-2D-63-62-63 2C-74-77-6F-66-69-73-68-32-35-36-2D-63-74-72-2C-74-77-6F-66-69-73-68-31 39-32-2D-63-74-72-2C-74-77-6F-66-69-73-68-31-32-38-2D-63-74-72-2C-74-77 6F-66-69-73-68-32-35-36-2D-63-62-63-2C-74-77-6F-66-69-73-68-31-39-32-2D 63-62-63-2C-74-77-6F-66-69-73-68-31-32-38-2D-63-62-63-2C-74-77-6F-66-69 73-68-2D-63-62-63-2C-62-6C-6F-77-66-69-73-68-2D-63-74-72-2C-62-6C-6F-77 66-69-73-68-2D-63-62-63-2C-61-72-63-66-6F-75-72-32-35-36-2C-61-72-63-66 6F-75-72-31-32-38-2C-61-72-63-66-6F-75-72-00-00-00-F1-61-65-73-32-35-36 2D-63-74-72-2C-61-65-73-31-39-32-2D-63-74-72-2C-61-65-73-31-32-38-2D-63 74-72-2C-61-65-73-32-35-36-2D-63-62-63-2C-61-65-73-31-39-32-2D-63-62-63 2C-61-65-73-31-32-38-2D-63-62-63-2C-33-64-65-73-2D-63-74-72-2C-33-64-65 73-2D-63-62-63-2C-74-77-6F-66-69-73-68-32-35-36-2D-63-74-72-2C-74-77-6F 66-69-73-68-31-39-32-2D-63-74-72-2C-74-77-6F-66-69-73-68-31-32-38-2D-63 74-72-2C-74-77-6F-66-69-73-68-32-35-36-2D-63-62-63-2C-74-77-6F-66-69-73 68-31-39-32-2D-63-62-63-2C-74-77-6F-66-69-73-68-31-32-38-2D-63-62-63-2C 74-77-6F-66-69-73-68-2D-63-62-63-2C-62-6C-6F-77-66-69-73-68-2D-63-74-72 2C-62-6C-6F-77-66-69-73-68-2D-63-62-63-2C-61-72-63-66-6F-75-72-32-35-36 2C-61-72-63-66-6F-75-72-31-32-38-2C-61-72-63-66-6F-75-72-00-00-00-12-68 6D-61-63-2D-73-68-61-31-2C-68-6D-61-63-2D-6D-64-35-00-00-00-12-68-6D-61 63-2D-73-68-61-31-2C-68-6D-61-63-2D-6D-64-35-00-00-00-04-6E-6F-6E-65-00 00-00-04-6E-6F-6E-65-00-00-00-00-00-00-00-00-00-00-00-00-00 2012-02-16 16:30:20.715 VERBOSE Sftp(1) SSH: Received packet SSH_MSG_KEXINIT (481 bytes). 14-7F-F2-13-B4-77-2A-4B-AA-FB-AF-C9-45-21-8D-79-96-00-00-00-36-64-69-66 66-69-65-2D-68-65-6C-6C-6D-61-6E-2D-67-72-6F-75-70-31-2D-73-68-61-31-2C 64-69-66-66-69-65-2D-68-65-6C-6C-6D-61-6E-2D-67-72-6F-75-70-31-34-2D-73 68-61-31-00-00-00-0F-73-73-68-2D-72-73-61-2C-73-73-68-2D-64-73-73-00-00 00-82-61-65-73-31-32-38-2D-63-62-63-2C-33-64-65-73-2D-63-62-63-2C-62-6C 6F-77-66-69-73-68-2D-63-62-63-2C-61-65-73-31-39-32-2D-63-62-63-2C-61-65 73-32-35-36-2D-63-62-63-2C-72-69-6A-6E-64-61-65-6C-31-32-38-2D-63-62-63 2C-72-69-6A-6E-64-61-65-6C-31-39-32-2D-63-62-63-2C-72-69-6A-6E-64-61-65 6C-32-35-36-2D-63-62-63-2C-72-69-6A-6E-64-61-65-6C-2D-63-62-63-40-6C-79 73-61-74-6F-72-2E-6C-69-75-2E-73-65-00-00-00-82-61-65-73-31-32-38-2D-63 62-63-2C-33-64-65-73-2D-63-62-63-2C-62-6C-6F-77-66-69-73-68-2D-63-62-63 2C-61-65-73-31-39-32-2D-63-62-63-2C-61-65-73-32-35-36-2D-63-62-63-2C-72 69-6A-6E-64-61-65-6C-31-32-38-2D-63-62-63-2C-72-69-6A-6E-64-61-65-6C-31 39-32-2D-63-62-63-2C-72-69-6A-6E-64-61-65-6C-32-35-36-2D-63-62-63-2C-72 69-6A-6E-64-61-65-6C-2D-63-62-63-40-6C-79-73-61-74-6F-72-2E-6C-69-75-2E 73-65-00-00-00-24-68-6D-61-63-2D-73-68-61-31-2C-68-6D-61-63-2D-73-68-61 31-2D-39-36-2C-68-6D-61-63-2D-6D-64-35-2C-6E-6F-6E-65-00-00-00-24-68-6D 61-63-2D-73-68-61-31-2C-68-6D-61-63-2D-73-68-61-31-2D-39-36-2C-68-6D-61 63-2D-6D-64-35-2C-6E-6F-6E-65-00-00-00-09-7A-6C-69-62-2C-6E-6F-6E-65-00 00-00-09-7A-6C-69-62-2C-6E-6F-6E-65-00-00-00-00-00-00-00-00-00-00-00-00 00 2012-02-16 16:30:20.743 DEBUG Sftp(1) SSH: Negotiating key. 2012-02-16 16:30:21.071 VERBOSE Sftp(1) SSH: Sending packet SSH_MSG_KEXDH_INIT (261 bytes). 1E-00-00-01-00-28-A0-9F-19-D5-2D-1E-07-44-19-37-5E-AB-C2-A3-0D-04-DD-EA A7-E5-06-74-AA-A3-68-84-1B-A8-B0-71-66-BF-43-E5-6E-B5-B3-9D-FC-72-B7-5B 99-8F-34-13-72-7C-E4-89-77-3C-C6-0A-6E-13-39-F6-61-42-CA-5B-45-8C-E5-5E E9-E5-0F-2D-04-49-60-B3-10-58-62-53-10-40-0B-E4-78-AB-DF-33-00-73-F1-6B DE-B3-9B-1B-EA-A0-C8-81-C9-95-9E-A9-94-09-80-E6-25-B0-C7-35-84-F4-AE-8E D3-4B-58-7D-20-45-67-AD-85-34-9E-BB-7B-95-3C-87-92-1B-1D-A0-85-6C-A7-EC 24-B8-1E-22-39-3C-5F-04-03-D2-41-1D-1A-E6-98-5D-07-21-A5-16-A4-67-42-0F 88-03-24-90-B0-71-F6-5D-24-1A-2E-15-91-DD-AB-04-99-32-7E-F6-7F-52-D3-6D DD-3E-B2-8C-FD-42-74-B6-34-6F-38-03-FA-9B-86-ED-A2-86-4D-B9-89-5E-15-23 FC-81-C5-D1-38-11-1C-66-54-E5-E0-A6-2E-22-77-4A-70-88-F9-68-7B-56-AE-B2 25-C3-61-BA-54-85-45-66-90-A6-00-0E-B7-E0-FD-BD-66-19-B7-37-67 2012-02-16 16:30:21.190 VERBOSE Sftp(1) SSH: Received packet SSH_MSG_KEXDH_REPLY (758 bytes). 1F-00-00-01-B2-00-00-00-07-73-73-68-2D-64-73-73-00-00-00-81-00-EA-A2-A6 AB-A7-2F-78-B3-D2-88-B4-1D-74-1C-2A-42-2E-FC-31-42-4D-FF-F3-36-2D-07-6D 13-3A-1E-E3-C9-D9-D1-AF-9F-2A-2D-34-EC-98-57-CB-BE-5E-FD-12-68-20-5F-71 7D-FC-43-FC-DD-64-8B-93-B9-7E-BE-07-1A-88-25-37-91-5A-EA-2A-94-39-1E-90 E2-0E-69-9D-47-9F-01-1A-0D-D7-64-EF-EA-A1-A2-0C-E6-AA-F9-FA-F0-BE-35-6A 5B-C0-B8-16-54-C6-EC-92-FF-4D-E4-01-8B-12-54-AC-37-01-16-7A-56-96-E9-30 E1-0A-6C-98-69-00-00-00-15-00-C4-32-00-3B-6E-D3-35-11-DB-4E-7C-36-1F-28 77-BF-7B-CE-7E-2F-00-00-00-80-18-5F-74-C6-D1-61-74-89-ED-75-C8-5E-87-A0 E0-D7-E2-65-C1-5B-F7-3D-27-8E-B0-6A-A9-BE-1E-1B-A7-12-CC-CA-DC-BD-7E-CF 9D-69-A3-91-B6-61-E3-19-F5-47-D0-CA-01-D5-9C-60-CA-32-E9-FF-77-65-B6-28 05-A1-D2-37-9D-39-20-4F-90-2E-F0-ED-7D-8D-7A-74-2C-F5-37-5B-5C-B6-AD-55 7B-D4-43-56-2A-0C-E3-D2-1C-BC-70-98-3C-7C-0B-67-39-F2-71-43-64-4D-CA-25 AC-54-8D-F0-3E-98-8C-FF-E9-C2-96-B2-EA-7A-AD-C4-55-C3-00-00-00-81-00-C2 E5-F5-6A-80-0B-AC-84-F7-36-1F-FB-67-CD-1E-18-9E-CA-FE-31-1D-90-26-76-37 21-0F-BE-FD-89-3E-00-F1-D0-BC-7D-0E-52-18-18-29-AC-EA-07-F0-F8-0F-A9-59 43-E9-EE-94-8C-31-04-A5-BB-5F-DA-B3-D9-24-0E-22-E2-85-5F-3D-FF-A1-96-F5 67-FD-2E-6E-CE-E0-6D-5C-A0-C4-91-6C-F5-DF-A0-F8-C7-07-47-2D-54-43-32-21 C1-69-88-23-73-92-48-3C-9F-38-E8-50-E4-1C-F7-B5-47-09-7F-B1-5C-B8-5C-81 CB-38-DC-C4-FF-7B-F9-00-00-01-00-25-AB-4C-F0-11-04-1D-52-FD-F0-63-D9-04 26-A6-55-FD-4D-FD-9C-D8-27-42-F0-D6-62-42-B2-A4-9C-18-1A-7A-D1-5E-98-4C 3D-22-26-26-8A-76-BD-DA-B5-1B-DE-4C-70-37-DF-7E-28-0B-3C-25-81-38-8A-35 FF-CC-30-06-D8-95-EA-AD-E9-B2-88-27-D2-10-DF-6A-28-28-17-0C-A2-4F-ED-03 39-B2-14-A3-42-83-F8-CB-C2-35-D3-2F-5B-EC-6A-86-E4-A4-17-AE-C1-74-AC-EA 01-D6-2D-92-D4-50-41-1C-2D-82-14-C8-A3-63-53-7D-CD-2E-85-BD-8C-4B-C6-60 B7-5C-98-CD-13-D4-65-64-26-CA-7C-60-8E-F9-AC-BD-DD-C9-1C-91-A6-3E-13-C5 A3-BF-9F-3D-6F-CC-C2-21-86-F3-C2-57-C8-E4-98-5C-D0-68-A2-8F-11-82-A4-3B 78-3C-48-DE-6D-E0-6F-9F-EA-D3-82-F0-CA-AB-63-7D-51-45-D1-54-6E-F9-CA-94 8F-65-70-76-CB-9C-B9-16-DB-0D-B9-2E-B1-85-4C-44-F6-D2-62-E7-6A-E0-97-52 E4-EF-BC-34-A9-74-C8-1C-F3-CD-14-FD-F5-41-77-EF-A1-65-AF-76-88-E3-1E-93 B3-66-20-00-00-00-37-00-00-00-07-73-73-68-2D-64-73-73-00-00-00-28-31-37 1D-B0-D3-95-B9-AD-42-F9-F5-F2-A4-90-25-65-33-72-EC-CC-23-F1-43-14-3B-5E 64-82-0C-58-85-4C-3E-E1-EF-B1-F8-0F-89-6B 2012-02-16 16:30:21.518 DEBUG Sftp(1) SSH: Validating signature. 2012-02-16 16:30:21.539 VERBOSE Sftp(1) SSH: Sending packet SSH_MSG_NEWKEYS (1 bytes). 15 2012-02-16 16:30:21.543 DEBUG Sftp(1) SSH: SSH connection closed. 2012-02-16 16:30

1 Answer

0 votes
answered Feb 17, 2012 by Lukas Pokorny (109,650 points)
edited Feb 17, 2012

It looks like the server just closes the connection and doesn't tell us why. The server's log might contain more info about this issue.

If you are able to connect fin using third-party SFTP clients (such as WinSCP or Filezilla), try forcing RSA host key algorithm (instead of default DSA) in Rebex SFTP and let us know whether this solves the issue. The appropriate C# code:

         Sftp client = new Sftp();

         // Create an instance of SshParameters class to specify desired arguments. 
         SshParameters par = new SshParameters();

         // RSA host key algorithm
         par.HostKeyAlgorithms = SshHostKeyAlgorithm.RSA;

         // Connect to the server. The third argument is the parameters class. 
         client.Connect(hostname, Sftp.DefaultPort, par);
...