Topic "WinSCP Scripting, How to accept by default the server's host"

Author Message
Mart'

Guest


Hi,
I need to use WinSCP to copy file on different Linux platform.
Their IP change, so WinSCP does not keep a host key in cache...

In scripting mode, Is there a command, that could be add in the scripting file, to automaticaly accept the host key?

I call the winscp.exe /script=scripting.txt from an application in Visual C++.

Regards,
Mart'
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Use -hostkey switch.
_________________
Martin Prikryl
Guest




prikryl wrote:
Use -hostkey switch.

Hi,

I'm not sure that I could use the -hostkey=<fingerprint> cmd!
Servers reboot and IP change...

Is there a scripting command that could be used and will force answer to be 'Y' at question:"Continue connecting and add host key to the cache? (Y)es, (N)o, C(a)ncel.."

Thank's
Mart
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Anonymous wrote:
I'm not sure that I could use the -hostkey=<fingerprint> cmd!
Servers reboot and IP change...

It does not matter that the IP changes, as long as the key stays the same.
_________________
Martin Prikryl
Chage

Guest


It would be better if there was an ability to automatically accept the certificate regardless of fingerprint - when automating a file copy for a large number of servers, I do not particularly want to manually obtain the key fingerprint for 150+ servers.

Yes, it has security ramifications, but one would expect you know what you are doing if you are needing to do this..

Maybe a feature request for a -forceacceptkey switch or something could resolve this?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Chage wrote:
It would be better if there was an ability to automatically accept the certificate regardless of fingerprint - when automating a file copy for a large number of servers, I do not particularly want to manually obtain the key fingerprint for 150+ servers.

Just for the first time, accept offered fingerprint and your are done.
_________________
Martin Prikryl
Andrei-BY

Guest


Martin,

I have similar issue too - I can login to SFTP manually running winscp.exe however when running batch mode it says

"If you trust this host, press Yes. To connect without adding host key to the cache, press No. To abandon the connection press Cancel."

Is there a way to clear the cache so I can accept the host key when opening SFTP site first time?

Thanks!
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