SFTP - 连接中止(C#)

时间:2016-06-20 18:01:09

标签: c# connection sftp abort

我有从sftp下载文件的工具。这个工具工作了2年,但现在它停止工作了。收到的错误是:

An established connection was aborted by the software in your host machine.

主机在客户站点上,从HOST获取任何日志非常复杂。我想问你可能的原因。

以下是我工具的日志:

2016-05-24 12:00:00,887 DEBUG [1] LoggingManager:0 Using key authentification, private key file: 'C:\Programme\PMS\SCPCopy\unionkey\pmsui_keyfile.id'.
2016-05-24 12:00:01,027 DEBUG [1] LoggingManager:0 Connecting to server: '1.1.1.1' port: '22'
2016-05-24 12:00:01,043 DEBUG [1] SSHDotNetSftpProvider:0 Connect...
2016-05-24 12:00:01,043 DEBUG [1] BaseClient:0 Connect
2016-05-24 12:00:01,058 DEBUG [1] ConnectionInfo:0 Attempt to create new session for the following connection info:
2016-05-24 12:00:01,058 DEBUG [1] ConnectionInfo:0 Host: 1.1.1.1
2016-05-24 12:00:01,058 DEBUG [1] ConnectionInfo:0 Port: 22
2016-05-24 12:00:01,058 DEBUG [1] ConnectionInfo:0 Username: XXXXX
2016-05-24 12:00:01,058 DEBUG [1] ConnectionInfo:0 ProxyType: None
2016-05-24 12:00:01,058 DEBUG [1] ConnectionInfo:0 ProxyHost:
2016-05-24 12:00:01,058 DEBUG [1] ConnectionInfo:0 ProxyPort: 0
2016-05-24 12:00:01,058 DEBUG [1] ConnectionInfo:0 ProxyUsername:
2016-05-24 12:00:01,058 DEBUG [1] ConnectionInfo:0 ProxyPassword:
2016-05-24 12:00:01,058 DEBUG [1] ConnectionInfo:0 RetryAttempts: 10
2016-05-24 12:00:01,058 DEBUG [1] ConnectionInfo:0 Encoding: System.Text.UTF8Encoding
2016-05-24 12:00:01,058 DEBUG [1] ConnectionInfo:0 MaxSessions: 10
2016-05-24 12:00:01,074 DEBUG [1] ConnectionInfo:0 KeyExchangeAlgorithm:
2016-05-24 12:00:01,074 DEBUG [1] ConnectionInfo:0 ServerEncryption:
2016-05-24 12:00:01,074 DEBUG [1] ConnectionInfo:0 ClientEncryption:
2016-05-24 12:00:01,074 DEBUG [1] ConnectionInfo:0 ServerHmacAlgorithm:
2016-05-24 12:00:01,074 DEBUG [1] ConnectionInfo:0 ClientHmacAlgorithm:
2016-05-24 12:00:01,074 DEBUG [1] ConnectionInfo:0 HostKeyAlgorithm:
2016-05-24 12:00:01,074 DEBUG [1] ConnectionInfo:0 ServerCompressionAlgorithm:
2016-05-24 12:00:01,074 DEBUG [1] ConnectionInfo:0 ClientCompressionAlgorithm:
2016-05-24 12:00:01,074 DEBUG [1] ConnectionInfo:0 ServerVersion:
2016-05-24 12:00:01,074 DEBUG [1] ConnectionInfo:0 ClientVersion:
2016-05-24 12:00:01,074 DEBUG [1] BaseClient:0 Attempt to create new session
2016-05-24 12:00:01,090 DEBUG [1] Session:0 Wait for the connection authentication
2016-05-24 12:00:01,105 DEBUG [1] Session:0 GetMessagesMetadata
2016-05-24 12:00:01,105 DEBUG [1] Session:0 Proxy type: None
2016-05-24 12:00:01,105 DEBUG [1] Session:0 Host: 1.1.1.1
2016-05-24 12:00:01,105 DEBUG [1] Session:0 Port: 22
2016-05-24 12:00:01,152 DEBUG [1] Session:0 ConnectionInfo: SSH-2.0-OpenSSH_7.2
2016-05-24 12:00:01,152 DEBUG [1] Session:0 ClientVersion: SSH-2.0-Renci.SshNet.SshClient.0.0.1
2016-05-24 12:00:01,152 DEBUG [1] Session:0 Server version: 2.0
2016-05-24 12:00:01,152 DEBUG [1] Session:0 Software name: OpenSSH_7.2
2016-05-24 12:00:01,277 DEBUG [1] LoggingManager:0 An error occured: An established connection was aborted by the software in your host machine.

对于sftp连接使用Renci.SshNet(版本2013.4.7)

1 个答案:

答案 0 :(得分:0)

Renci.SshNet(版本2013.4.7)存在问题。此版本能够与SSH-2.0-OpenSSH_6.7通信,但不能与SSH-2.0-OpenSSH_7.2通信。

Renci.SshNet的实际版本解决了这个问题。