views:

138

answers:

1

When i ssh to a machine, sometime i get this error warning and it prompts to say "yes" or "no". This cause some trouble when running from scripts that automatically ssh to other machines.

Is there a way to automatically say "yes" or ignore this?

+1  A: 

Depending on your ssh client, you can set the StrictHostKeyCecking option to no on the command line, and/or send the key to a null known_hosts file. You can also set these options in your config file, either for all hosts or for a given set of IP addresses or host names.

ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no

Reference.

cori