KEX negotiation failed using curve25519-sha256
See original GitHub issueWith the develop branch, I’ve already ran a few times into a KEX failure:
Renci.SshNet.Common.SshConnectionException: Key exchange negotiation failed. at Renci.SshNet.Session.WaitOnHandle(WaitHandle waitHandle, TimeSpan timeout) at Renci.SshNet.Session.Connect() at Renci.SshNet.BaseClient.CreateAndConnectSession() at Renci.SshNet.BaseClient.Connect()
I’m testing again OpenSSH 8.0p1 (Ubuntu 19.10 Desktop).
The following simple code fragment should allow you to reproduce this issue:
using Renci.SshNet;
using System;
using System.Linq;
using System.Threading.Tasks;
class ConnectDisconnect
{
private static void Main(string[] args)
{
if (args.Length != 3)
{
Console.Error.WriteLine("Please specify the host name, user name and password.");
return;
}
var hostName = args[0];
var userName = args[1];
var password = args[2];
var tasks = Enumerable.Range(1, 10).Select(y =>
{
return Task.Factory.StartNew(() =>
{
for (var i = 0; i < 500; i++)
{
using (SftpClient client = new SftpClient(args[0], userName, password))
{
client.Connect();
Console.Write(".");
}
}
});
}).ToArray();
Task.WaitAll(tasks);
}
}
Note: It could take a while for this issue to reproduce.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
key exhange negotiation failed though client and server ...
Unable to negotiate with XYZ port 22: no matching host key type found. Their offer: ssh-rsa fatal: Could not read from remote repository....
Read more >JSch connection issue: JSchException: Algorithm ...
I am able to connect to the server using PuTTY but not using Java code. I am using jdk1.8.0_171. Here is the code...
Read more >openssh - SSH stopped working after a server update ...
Turns out the new version was not broken - but OpenBSD/OpenSSH starting changing the key exchange defaults starting with OpenSSH-6.7p1 see: ...
Read more >Putty SSH client key exchange fails after upgrade from ...
sshd[5210]: Unable to negotiate with 192.168.1.20 port 533 07: no matching key exchange method found. Their offer: diffie-hellman-group-exc ...
Read more >Cannot connect SFTP server: Failed to negotiate key ...
Hi,. We are using the FTP provider with the sFTP protocol and got the following error: Cannot connect SFTP server: Failed to negotiate...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I’ve fixed my changes, and up to now I’ve not been able to reproduce this issue again. I’ll commit the fix tomorrow.
@darinkes No problem, I can admit my mistakes. Like I always say: “I’ve made many mistakes, but I’m not married”. My gf doesn’t always appreciate this. Not sure why.