Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WinSCP .NET library: Connect to SFTP server without specifying SSH host key fingerprint

In the current stable release of WinSCP, it seems that using SshHostKeyFingerprint is mandatory and there are no ways to connect to SFTP server without that in SessionOptions. I can see that the ability to bypass is added to the beta (5.2) but I was wondering whether or not it's possible to connect without this fingerprint.

like image 871
user446923 Avatar asked Oct 28 '25 17:10

user446923


1 Answers

First, make sure you understand that you give-up any security, when you try to bypass SSH host key check. You effectively lose a protection against man-in-the-middle attacks.

Anyway, you can set the SessionOptions.SshHostKeyPolicy to SshHostKeyPolicy.GiveUpSecurityAndAcceptAny.

It's NOT recommended though. You should always set SessionOptions.SshHostKeyFingerprint.
Learn how to determine SSH host key fingerprint. Or at least use the SshHostKeyPolicy.AcceptNew.

See also Suppress the use of host key in SFTP or SCP using WinSCP.

like image 162
Martin Prikryl Avatar answered Oct 31 '25 10:10

Martin Prikryl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!