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
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.
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.
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.
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.
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".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With