Skipping SSH Host Checking

Often, when we perform automated tasks involving SSH, the host verification pops up, requiring human interaction.

This can also cause problems if a task has been running for a long time and one day we migrate a server to a new IP—suddenly the task stops working because the fingerprint changed.

To skip this verification, we have two options:

1. Preload the fingerprint

ssh-keyscan IP.ADDR.OF.HOST >> ~/.ssh/known_hosts

This avoids the prompt asking whether to accept the fingerprint the first time you connect.

Disable host verification

You can skip host checking by adding something like this to your SSH config file (~/.ssh/config):

Host my_trustable_host
    Hostname IP.ADDR.OF.HOST
    StrictHostKeyChecking no

Warning: This can introduce a potential security risk, but it simplifies automated tasks.