ssh-keyscan - is a utility for gathering the public SSH host keys of a number of hosts
To read all public keys from the host $ ssh-keyscan 192.168.122.50
To read all public keys from the host at port number 22 $ ssh-keyscan -p 22 192.168.122.50
To read all public keys of the rsa type $ ssh-keyscan -t rsa 192.168.122.50
To update the known_hosts file located in the path, ~/.ssh/known_hosts $ ssh-keyscan -H 192.168.122.50 >> ~/.ssh/known_hosts
regards, T.Dhanasekar