The full error message is: Negotiation failed. The client and the server have no common key exchange algorithm. Server supports 'diffie-hellman-group1-sha1' which is weak and not enabled at the client.
How do I enable 'diffie-hellman-group1-sha1' ?
This legacy algorithm can be enabled using Sftp object's Settings.SshParameters.KeyExchangeAlgorithms property:
Sftp
Settings.SshParameters.KeyExchangeAlgorithms
var client = new Sftp(); client.Settings.SshParameters.KeyExchangeAlgorithms |= SshKeyExchangeAlgorithm.DiffieHellmanGroup1SHA1; client.Connect(serverName); ...
For additional information, see SSH ciphers and Setting connection options.
Also, please be aware that the diffie-hellman-group1-sha1 cipher is not secure.
diffie-hellman-group1-sha1
Welcome to Q&A forum for C# and VB.NET developers working with following .NET components:
Applications:
If you need immediate assistance, please contact us directly.