是否可以在 Renci SSH.NET 上正常工作(不是 SFTP)FTP? - 使用哪个客户端?
Is it possible to work on normal (not SFTP) FTP on Renci SSH.NET? - which client to use?
我正在使用 Renci SSH.NET,但正在尝试在 FTP(不是 SFTP 站点)上进行测试。
我确实在 WinSCP 上使用了它 - 但无法在 Renci 上使用它 -
WinSCP 允许我将协议设置为 FTP 或 SFTP - 我认为这是问题 - 我被提示
No suitable authentication method found to complete authentication (publickey,keyboard-interactive).
如何在 Renci SSH.NET 上关闭 SFTP(并且只使用 FTP)?我试过了
Dim c As Renci.SshNet.SftpClient / ScpClient/ BaseClient / NetConfClient
代码如下:
Private Sub LancerUpload()
Dim PWAuthMeth = New PasswordAuthenticationMethod(Login, Password)
Dim KIAuthMeth = New KeyboardInteractiveAuthenticationMethod(Login)
AddHandler KIAuthMeth.AuthenticationPrompt, AddressOf HandleKeyEvent
Dim ConnectionInfo As New ConnectionInfo(ServerName, 22, Login, PWAuthMeth, KIAuthMeth)
Dim SshClient1 As New SshClient(ConnectionInfo)
Try
SshClient1.Connect()
Catch ex As Exception
MsgBox(ex.ToString())
End Try
MsgBox(SshClient1.IsConnected)
End Sub
Private Sub HandleKeyEvent(sender As Object, e As Renci.SshNet.Common.AuthenticationPromptEventArgs)
For Each prompt As Renci.SshNet.Common.AuthenticationPrompt In e.Prompts
If prompt.Request.IndexOf("Password:", StringComparison.InvariantCultureIgnoreCase) <> -1 Then
prompt.Response = Password
End If
Next
End Sub
正如名字所说,Renci SSH.NET 库是一个 SSH 库。
FTP 与 SSH 和 SFTP 无关。反之SFTP,什么在SSH的子系统中。
所以不,你不能使用 Renci SSH.NET 作为 FTP 协议。
您可能想阅读 Is "SFTP" and "FTP over SSL" a same thing? and Differences between SFTP and "FTP over SSH"。
我正在使用 Renci SSH.NET,但正在尝试在 FTP(不是 SFTP 站点)上进行测试。
我确实在 WinSCP 上使用了它 - 但无法在 Renci 上使用它 - WinSCP 允许我将协议设置为 FTP 或 SFTP - 我认为这是问题 - 我被提示
No suitable authentication method found to complete authentication (publickey,keyboard-interactive).
如何在 Renci SSH.NET 上关闭 SFTP(并且只使用 FTP)?我试过了
Dim c As Renci.SshNet.SftpClient / ScpClient/ BaseClient / NetConfClient
代码如下:
Private Sub LancerUpload()
Dim PWAuthMeth = New PasswordAuthenticationMethod(Login, Password)
Dim KIAuthMeth = New KeyboardInteractiveAuthenticationMethod(Login)
AddHandler KIAuthMeth.AuthenticationPrompt, AddressOf HandleKeyEvent
Dim ConnectionInfo As New ConnectionInfo(ServerName, 22, Login, PWAuthMeth, KIAuthMeth)
Dim SshClient1 As New SshClient(ConnectionInfo)
Try
SshClient1.Connect()
Catch ex As Exception
MsgBox(ex.ToString())
End Try
MsgBox(SshClient1.IsConnected)
End Sub
Private Sub HandleKeyEvent(sender As Object, e As Renci.SshNet.Common.AuthenticationPromptEventArgs)
For Each prompt As Renci.SshNet.Common.AuthenticationPrompt In e.Prompts
If prompt.Request.IndexOf("Password:", StringComparison.InvariantCultureIgnoreCase) <> -1 Then
prompt.Response = Password
End If
Next
End Sub
正如名字所说,Renci SSH.NET 库是一个 SSH 库。
FTP 与 SSH 和 SFTP 无关。反之SFTP,什么在SSH的子系统中。
所以不,你不能使用 Renci SSH.NET 作为 FTP 协议。
您可能想阅读 Is "SFTP" and "FTP over SSL" a same thing? and Differences between SFTP and "FTP over SSH"。