Howto: ssh automatically add new hosts to the list of known hosts

Posted on In QA

When managing many hosts, answering 100s of “yes” can make us crazy. In a trusted environment, let ssh automatically add the new hosts to the list of known hosts and free us from typing “yes”es. How to enable it?

Method 1. Passing option to ssh

ssh -o StrictHostKeyChecking=no username@host

Method 2. Configuring ~/.ssh/config

To automatically add hosts starting with 10.*

Host 10.* 
   StrictHostKeyChecking no

Leave a Reply

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