Connecting with SSH.NET to OpenSSH 7.4p1 fails with “The server response contains a null character at position” but works in WinSCP
问题 I am trying to connect to an SFTP server using SSH.NET (2020.0.0). My code looks as simple as this: try { var x = new ConnectionInfo(FtpIpAddress, 22, FtpUser, new PasswordAuthenticationMethod(FtpUser, FtpPw)); using (var sftpClient = new SftpClient(x)) { sftpClient.Connect(); sftpClient.Disconnect(); } } catch (Exception e) { Console.WriteLine(e.Message); } But when I run the code, I get following error: The server response contains a null character at position 0x00000028: 00000000 53 53 48