6

Are there any tricks to get the public key (the line that goes into the known_hosts file after I answered yes after connecting with ssh) of a server?

1
  • I just want to check that behind a domain is the IP that is really behind the domain. (I can check this by comparing the public ssh key of the domain+IP - so I need to connect twice with ssh client: once using the domain as destination, and once using the IP as destination that I got from the dig command) May 7, 2012 at 1:16

1 Answer 1

12

Try ssh-keyscan domain-name and it'll output the public key for you.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .