Is it possible to work on normal (not SFTP) FTP on Renci SSH.NET? - which client to use?

不想你离开。 提交于 2019-12-04 01:09:47

问题


I am using Renci SSH.NET, but trying to test on a FTP (not SFTP site).

I did get this working with WinSCP - but cannot get it to work on Renci - WinSCP allows me to set the protocol to either FTP or SFTP - I think this is the issue - I am prompted for

No suitable authentication method found to complete authentication (publickey,keyboard-interactive).

How do I turn off SFTP (and just use FTP) on Renci SSH.NET? I tried

Dim c As Renci.SshNet.SftpClient /  ScpClient/ BaseClient / NetConfClient

here is code:

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

回答1:


As the name says, the Renci SSH.NET library is an SSH library.

The FTP has nothing to do with the SSH nor the SFTP. Contrary to the SFTP, what in an subsystem of the SSH.

So no, you cannot use the Renci SSH.NET for the FTP protocol.

You may want to read Is "SFTP" and "Ftp over SSL" a same thing? and Differences between SFTP and "FTP over SSH".



来源:https://stackoverflow.com/questions/35718561/is-it-possible-to-work-on-normal-not-sftp-ftp-on-renci-ssh-net-which-client

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