1

I have a script which runs and makes the assumption that the remote host key is in known_hosts when running some commands which use SSH.

I would like to know if there is some command that can be ran that will output the remote host key status before these scripts fire. I think there must be something more ideal than trying to start an 'ssh' session though?

Justin
  • 113
  • 2

1 Answers1

0

You can use ssh-keyscan to retrieve the host keys of a remote host. However, I'm afraid you'll have to write a few lines of shell code to check wether you have these in your known_hosts or not.

Andreas Rogge
  • 2,853
  • 11
  • 24