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

Author Message
Sasidharan9513
[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 = "example.com",
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
}



Regards,
S.Sasidharan
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
It's must.
Please read:
https://winscp.net/eng/docs/ssh#verifying_the_host_key
Advertisements

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!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License