【问题标题】:Is it possible to work on normal (not SFTP) FTP on Renci SSH.NET? - which client to use?是否可以在 Renci SSH.NET 上使用普通(不是 SFTP)FTP? - 使用哪个客户端?
【发布时间】:2016-06-13 14:44:29
【问题描述】:

我正在使用 Renci SSH.NET,但尝试在 FTP(不是 SFTP 站点)上进行测试。

我确实在 WinSCP 上得到了这个 - 但不能让它在 Renci 上工作 - WinSCP 允许我将协议设置为 FTP 或 SFTP - 我认为这是问题所在 - 系统会提示我

找不到合适的身份验证方法来完成身份验证(公钥、键盘交互)。

如何在 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

【问题讨论】:

    标签: ftp sftp ssh.net


    【解决方案1】:

    顾名思义,Renci SSH.NET 库是一个 SSH 库。

    FTP 与 SSH 和 SFTP 无关。与 SFTP 不同,SSH 的子系统中有什么。

    所以不,您不能将 Renci SSH.NET 用于 FTP 协议。

    您可能想阅读Is "SFTP" and "FTP over SSL" a same thing?Differences between SFTP and "FTP over SSH"

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-06-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-10
      相关资源
      最近更新 更多