5

I use SharpSSH .NET library for SFTP.
http://www.tamirgal.com/blog/page/sharpssh.aspx

When I try to connect the server I get an error

Algorithm negotiation fail

my print screen error

But when try to connect by FileZilla it works with no problems.

I find some with the same error but I do not find how to resolve this problem.

Like here: http://www.samhohce.net/questions/30190272/jsch-algorithm-negotiation-fail

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
24sharon
  • 1,859
  • 7
  • 40
  • 65

3 Answers3

3

Do not use SharpSSH. It's not maintained since 2007!

It's likely insecure. And does not support modern ciphers and KEX algorithms (hence the error).

Pick another C# SFTP library.

Community
  • 1
  • 1
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
1

Linux has update openSSH, and no longer use diffie-hellman-group1-sha1 and diffie-hellman-group-exchange-sha1, you should add

"Ciphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,arcfour128,arcfour256,arcfour,blowfish-cbc,cast128-cbc

MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-sha1-96,hmac-md5-96

KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,curve25519-sha256@libssh.org " in linux /etc/ssh/sshd_config

0

If anyone has to support this, I fixed it by enabling the right encryption.

Check the logs on your SFTP server and enable the encryption standard it's trying to use.

RdeV
  • 173
  • 1
  • 10