Session open with tunneling
SessionOptions sOs = new SessionOptions { Protocol = Protocol.Sftp, HostName = "<MyServerFQDN>", PortNumber = <Port>, UserName = "<UserName>", Password = "<PassWd>", SshHostKeyFingerprint = "<MyServer'sFingerPrint>" }; using (Session session = new Session()) { // Connect sOs.AddRawSettings("Tunnel", "1"); sOs.AddRawSettings("TunnelHostName", "<MyTunnelServer"); sOs.AddRawSettings("TunnelPortNumber", "<TunnelPort>"); sOs.AddRawSettings("TunnelUserName", "<TunnelUser>"); sOs.AddRawSettings("TunnelPublicKeyFile", "<TunnelUser'sPPK>"); session.Open(sOs); }
But I got an Error message like this :
I cannot understand how to set the tunnel server's fingerprint. I guess it may exist in theError: WinSCP.SessionRemoteException: Host key wasn't verified! ---> WinSCP.SessionRemoteException: Host key fingerprint is <Tunnel Server's Fingerprint>
Authentication failed.
[SshHostKeys]
section in the WinSCP.ini
file, but I could not use it.
Would you tell me how to set tunnel server's fingerprint? Or is there any other workaround?
Thanks!