Topic "How to make winscp automatically accept server host key?"

Author Message
JmenoBezCeskychZnakuBoze
[View user's profile]

Joined: 2014-08-07
Posts: 5
I'm writing a script to transfer data via winscp using its powershell functionality.

I need to use SFTP and automatically accept host key fingerprint on first connection and on all further ones, no matter what is the value.
How do I script that, pls?

When I write a script without specifying hostkey, it throws this back at me:

Exception calling "Open" with "1" argument(s): "SessionOptions.Protocol is Protocol.Sftp or Protocol.Scp, but SessionOptions.HostKey is not set."
Advertisements
JmenoBezCeskychZnakuBoze
[View user's profile]

Joined: 2014-08-07
Posts: 5
I might have phrased it a bit better...

Well, simply. I don't have a fingerprint of that server key and I don't care about changes of the server key. I don't want to use the fingerprint and want to accept the server key automatically without any prompt. How can I suppress the prompt and accept it automatically without having fingerprint?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24995
Location: Prague, Czechia
Use SessionOptions.GiveUpSecurityAndAcceptAnySshHostKey.
Please read documentation, boze:
https://winscp.net/eng/docs/library_sessionoptions
_________________
Martin Prikryl
JmenoBezCeskychZnakuBoze
[View user's profile]

Joined: 2014-08-07
Posts: 5
Thanks, Bože.

This feature wasn't available in the old version I had.
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