Hi Bob,
so I my understanding is, that you sometimes get some warnings / errors about cssh host keys and their fingerprints, after DNS names or IPs have been changed?
Well, that is a security feature, so I agree that disabling it -o
StrictHostKeyChecking=no
might not be the best choice.
The two other options coming to my mind would be to update .ssh/known_hosts after such a change. You can remove old entries via ssh-keyscan -R <hostname>
and ssh-keyscan -R <ip>
. When you now reconnect, you bill asked to verify and accept the host key again, and it will work again till the next dns / ip change.
Other option would be to move the ssh fingerprints to DNS, and tell your ssh client to get and verify them. https://en.wikipedia.org/wiki/SSHFP_record has a short description about these entries.
The first method has the benefit, that it is easier to implement, the second method is more complicate but has the big benefit, that it scales well, if many systems / users would require to update their known_hosts entries.
Best regards,
Alexander
------------------------------
Alexander Reichle-Schmehl
------------------------------
Original Message:
Sent: Fri May 12, 2023 10:47 AM
From: Bob Wyatt
Subject: sftp scripting, certificate or remote server updates
Phill,
We definitely would not want to use the -o StrictHostKeyChecking=no option...
Although we are not transferring financial data, we are transferring data that can be used to identify our clients.
The sending system must maintain PCI compliance standards.
Regards,
Bob Wyatt
------------------------------
Bob Wyatt
Original Message:
Sent: Fri May 12, 2023 04:56 AM
From: Phill Rowbottom
Subject: sftp scripting, certificate or remote server updates
You could try -o StrictHostKeyChecking=no, this should have sftp ignore the change of the certificate. This of course does turnoff the security that is provided by checking for changes to the certificate.
------------------------------
Phill Rowbottom
Original Message:
Sent: Wed May 10, 2023 11:01 AM
From: Bob Wyatt
Subject: sftp scripting, certificate or remote server updates
From time to time, our sftp scripts fail due to remote server changes - DNS, IP address, certificate update, or other facets of verifying the remote host associated with the certificate.On occasion, the service provider fails to advise us of the change(s) or that an updated certificate is available.
In using sftp and scripts, we have to run sftp manually to update our certificate stores when the service we are transferring records to has had undocumented changes. This infers that we may have multiple event failures before recognizing that a problem occurred (yes, we do have logs, but we don't have a "log monitor" to verify success or failure. This is something we need to incorporate, but isn't the reason for this post.
Generally, the question is how do you handle these unannounced service changes that result in failing to transfer the file(s) to the service provider in a timely manner? Is there a way to verify the certificate in the sftp script and automatically accept the newly-presented certificate? And I recognize there are dangers with that as well - site spoofing or other compromises we or they may not be aware of.
What do you do?
Thanks in advance,
Bob Wyatt
------------------------------
Bob Wyatt
------------------------------