Setting up a new environment of Linux boxes either Physical servers, VMs or Containers, one thing to consider is how you will login or manage those devices. In Linux world, SSH is the most common way to manage headless servers or VMs. SSH keys must be added to ~/.ssh/known_hosts to preload to the host keys before connecting to the new servers. There quite a few ways to do it, via bash script, or simply logging in and copying manually the key.but quite tedious and not the practical way if there are hundreds of more servers. ssh-keyscan server1 server2 server3 >> ~/.ssh/known_hosts This will suppress the question whether you want to add the keys or not, and type yes to continue. ssh-keyscan won't require any manual intervention once the connectivity is established it will just add all the keys available on the remote servers to known_hosts. Yes rather than typing ssh-keyscan server1 server2 it would be better to have a list on a text file and use while loop to read the file and...
Make the world a better place by sharing knowledge, ideas and anything that you can give that comes from the heart.