I have two VMs.
- VM-instance-1
- VM-instance-2
These two connect to each other over ssh back and forth for some automate tasks using user1.
Issue is that these two gets reprovisioned momentarily and after that we have to manually authenticate fingerprint for ssh to work.
I tried adding id_rsa.pub for each of them to other known_hosts and persist the known_hosts file to replace the new ones after reprovisioning.
However, the issue is every time while reprovisioning when the new ssh-keygen is done it generates new keys, hence the persisting known_hosts is useless.
What can be done for these hosts to remember each other’s and their own fingerprints so we don’t need to manually authenticate fingerprint every time.