Renci.SshNet : “server response does not contain ssh protocol identification”

非 Y 不嫁゛ 提交于 2019-12-01 11:32:01

I solve it for my self only with connections retrying attempts. Didn't find what exactly the issue is, but have this connection issue many times.

Example:

int attempts = 0;
            do
            {
                try
                {
                    client.Connect();
                }
                catch (Renci.SshNet.Common.SshConnectionException e)
                {
                    attempts++;
                }
            } while (attempts < _connectiontRetryAttempts && !client.IsConnected);

I experienced the same odd error message when attempting to connect to a SFTP server while using the SSH.NET library in a program on the server. The problem did not appear while testing from my development machine.

The solution was to have our server team add the IP address of the server into the hosts.allow file on the SFTP Linux server.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!