【发布时间】:2021-02-02 04:57:07
【问题描述】:
当我尝试使用 SSH.NET 连接到大型机时遇到问题。
有时我尝试连接到大型机,给我错误:
不支持超过 2147483647 的数据。 它不会一直发生,但有时会出现此错误。
你们知道这是什么吗?
这是我连接到服务器的方式。
我正在使用带有由 PuTTYgen 生成的公钥/私钥对 SSH 2048 的 SSH.NET:
Dim keystrm As MemoryStream = New MemoryStream(Encoding.ASCII.GetBytes(PASSWORD))
Dim privateKey = New Renci.SshNet.PrivateKeyFile(keystrm, PassPhrase)
Dim keyFiles As Renci.SshNet.PrivateKeyFile() = {privateKey}
Dim methods As List(Of Renci.SshNet.AuthenticationMethod) =
New List(Of Renci.SshNet.AuthenticationMethod)()
methods.Add(New Renci.SshNet.PrivateKeyAuthenticationMethod(USER, keyFiles))
Dim con = New Renci.SshNet.ConnectionInfo(SERVER, 222, USER, methods.ToArray())
Using client As New Renci.SshNet.SftpClient(con)
client.Connect()
client.UploadFile(stream, aux)
End Using
【问题讨论】:
标签: .net vb.net ssh sftp ssh.net