Topic "winscp .NET assembly open sftp session with out Hostkey"

Author Message
[View user's profile]

Joined: 2012-11-08
Posts: 11
Hi There,

I am getting the below error when I am open a session with out giving the Host key informtion.

"SessionOptions.Protocol is Protocol.Sftp , but SessionOptions.HostKey is not set."

Is is possible to open a sftp session with out giving a host key or host key is a must?

My Code :

SessionOptions sessionOptions = new SessionOptions
Protocol = Protocol.Sftp,
HostName = "",
UserName = "username",
Password = "password"

using (Session session = new Session())
// Connect
session.DisableVersionCheck = false;
session.Open(sessionOptions); ---- get error in this line since I am not giving Host Key info

[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24759
Location: Prague, Czechia
It's must.
Please read:

You can post new topics in this forum

Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License