ssh-keyscan command examples

ssh-keyscan command examples

ssh-keyscan — gather ssh public keys

Print the rsa host key for machine hostname:

$ ssh-keyscan hostname

Find all hosts from the file ssh_hosts which have new or different keys from those in the sorted file ssh_known_hosts:

$ ssh-keyscan -t rsa,dsa,ecdsa -f ssh_hosts | sort -u - ssh_known_hosts | diff ssh_known_hosts

 

Also See : ssh-copy-id

Leave a Reply

Your email address will not be published. Required fields are marked *