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

Advertisement

Mart'
Guest

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

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'

Reply with quote

Advertisement

Guest

Re: WinSCP Scripting, How to accept by default the server's host

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.."

Thanks
Mart

Reply with quote

martin
Site Admin
martin avatar

Re: WinSCP Scripting, How to accept by default the server's host

It does not matter that the IP changes, as long as the key stays the same.

Reply with quote

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?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
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.

Reply with quote

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!

Reply with quote

Advertisement

You can post new topics in this forum