How to bypass SSH destination host key fingerprint check?
When you first connect to a host,
ssh asks you about saving its fingerprint. If you do, on subsequent connections it will check the fingerprint and refuse to connect if it changed.
I get that this is a security measure in case someone tries to impersonate my server.
However, it is also very annoying when using a VPS. I give my public key to the VPS provider, so that it gets spun up with the key "baked in", and I can do a one click reset. But when I do reset, because the new machine is technically a different machine,
ssh predictably pouts and complains. However, obviously it's fine for the fingerprint to not match, because I just re-provisioned the server myself a minute ago! But,
ssh doesn't know that.
Right now I have to open
~/.ssh/known_hosts, find the line for me host among the many in there, delete it, try again, press yes again... Not the end of the world but a bit tedious.
Isn't there some CLI switch or something that tells SSH to stop whining about fingerprints just this time, and just automatically update
known_hosts for me?