How to update ini file in advance of SSH host key changing

Advertisement

darrend
Guest

How to update ini file in advance of SSH host key changing

We use automation and simple 'DOS scripting' - sites and ini files.
3rd party that we connect to has told us they will be changing their SSH keys in a couple of weeks, and have passed us the new public certs.
Question is how can I (or is it even possible to) update the ini file in advance of the change so that we dont get prompted to accept the new host key when they do finally switch over?
Thanks
Darren.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,504
Location:
Prague, Czechia

Re: How to update ini file in advance of SSH host key changing

If you use scripting, you should have your host key fingerprint in your script in the -hostkey switch.
https://winscp.net/eng/docs/scriptcommand_open#hostkey
https://winscp.net/eng/docs/scripting#hostkey

You can put fingerprints of both the current and the future host key to the switch, semicolon-separated:
open sftp://username:password@example.com/ -hostkey="current fingerprint;future fingeprint"

Reply with quote

Advertisement

You can post new topics in this forum