Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

sftp

ftp

ssh.net

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
like image 689
Peter PitLock Avatar asked Mar 01 '16 09:03

Peter PitLock


People also ask

Is SSH FTP the same as SFTP?

While FTPS adds a layer to the FTP protocol, SFTP is an entirely different protocol based on the network protocol SSH (Secure Shell). Unlike both FTP and FTPS, SFTP uses only one connection and encrypts both authentication information and data files being transferred.

Does SFTP work over SSH?

SFTP (SSH File Transfer Protocol) is a secure file transfer protocol. It runs over the SSH protocol. It supports the full security and authentication functionality of SSH. SFTP has pretty much replaced legacy FTP as a file transfer protocol, and is quickly replacing FTP/S.

How do I know if I have FTP or SFTP?

The key difference between FTP vs SFTP is that SFTP uses a secure channel to transfer files while FTP doesn't. With SFTP, your connection is always secured and the data that moves between your FTP client and your web server is encrypted.

Does .NET support SFTP?

More .NET componentsProvides secure remote file system access over an SSH channel using the SFTP protocol. Makes it easy to transfer files between your application and Unix/Windows SSH servers.


1 Answers

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 a 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".

like image 169
Martin Prikryl Avatar answered Oct 19 '22 01:10

Martin Prikryl