Defina StrictHostKeyChecking no
no seu arquivo / etc / ssh / ssh_config, onde será uma opção global usada por todos os usuários no servidor. Ou defina-o no arquivo ~/.ssh/config
, onde será o padrão apenas para o usuário atual. Ou você pode usá-lo na linha de comando:
ssh -o StrictHostKeyChecking=no -l $user $host
Veja uma explicação de como isso funciona em man ssh_config
:
StrictHostKeyChecking
If this flag is set to “yes”, ssh will never automatically add
host keys to the $HOME/.ssh/known_hosts file, and refuses to
connect to hosts whose host key has changed. This provides max-
imum protection against trojan horse attacks, however, can be
annoying when the /etc/ssh/ssh_known_hosts file is poorly main-
tained, or connections to new hosts are frequently made. This
option forces the user to manually add all new hosts. If this
flag is set to “no”, ssh will automatically add new host keys to
the user known hosts files. If this flag is set to “ask”, new
host keys will be added to the user known host files only after
the user has confirmed that is what they really want to do, and
ssh will refuse to connect to hosts whose host key has changed.
The host keys of known hosts will be verified automatically in
all cases. The argument must be “yes”, “no” or “ask”. The
default is “ask”.