How to Disable Strict Host Key Checking Using the Command Line

December 14, 2022 / How-to Guide

In this guide, we have explained how to disable strict host key checking using the command line. The strict-host-key-checking command agrees with how host keys are checked through the connection and verification phase.

Follow the procedure:

  1. Using the StrictHostKeyChecking=no command line argument, you can skip the host key verification process.
    ssh -o StrictHostKeyChecking=no user@remote-host
  2. Config file usage
    In the configuration file, you can also define strings that disable host key checking. It is necessary to create a ~/.ssh/config file and add the following content to disable strict host key checking.
    vi ~/.ssh/config
    Host *
    StrictHostKeyChecking no
  3. Host checking will be disabled for all hosts you connect with. Instead of disabling the host check for all hosts, disabling a particular host would be preferable.
    Host 192.168.1.10
    StrictHostKeyChecking no
  4. Set the file’s permissions to make it read-only for the user as well.
    sudo chmod 400 ~/.ssh/config

In this way, strict host key checking can be disabled from the command line. Please feel free to contact our support staff at any time if you have any questions.

When working with SSH it is important to know how to manage SSH keys. Make sure you’ve generated an SSH key pair before you disable strict host key checking.

If you haven’t already, you can use our guide to generate an SSH key pair. When your SSH key pair is generated, you can use the command line to disable strict host key checking.

Dominos Search