Re: Fail to Connect SFTP
It works!
I have add this code as your suggest
sessionOptions.AddRawSettings("TunnelHostKey", "ssh-rsa 1024 xxx")
thank you so much for your help
sessionOptions.AddRawSettings("TunnelHostKey", "ssh-rsa 1024 xxx")
Expected host key was not configured, use -hostkey switch.
Host key fingerprint is xxxx.
Authentication failed.
' Set up session options
Dim sessionOptions As New SessionOptions
With sessionOptions
.Protocol = Protocol.Sftp
.HostName = "xxx.net"
.UserName = "username"
.Password = "password"
.SshHostKeyFingerprint = "ssh-rsa 1024 xxx"
End With
sessionOptions.AddRawSettings("Tunnel", "1")
sessionOptions.AddRawSettings("TunnelHostName", "255.255.255.255")
sessionOptions.AddRawSettings("TunnelUserName", "user")
sessionOptions.AddRawSettings("TunnelPublicKeyFile", "C:%5CUsers%5CAdministrator%5CDesktop%5CFile.ppk")
Using session As New Session
' Connect
session.Open(sessionOptions)
' Your code
End Using