« Back to SSH: Frequently Asked Questions

How to disable the SSH host key check?

How to disable the SSH check of host authenticity and the key fingerprint?

Define the StrictHostKeyChecking option and set it to 'no' when connecting.

ssh -o StrictHostKeyChecking=no user@hostname

The ssh command can be instructed to ignore incorrect host keys with the -o StrictHostKeyChecking=no option. This sets the option StrictHostKeyChecking to ignore changed host keys.

This setting can also be configured in /etc/ssh_config to define it as its default. An alternative is to define it per host, in the file in your home directory ~/.ssh/config .

Command line usage

To use this option on the command line, specify the setting and set it to no.

ssh -o StrictHostKeyChecking=no user@hostname

Possible security impact

Disabling this check may increase the risk of a MitM attack. When possible, try to confirm why the host key changed. When using a hostname, confirm first that the name resolution is correct.

Other questions related to SSH

    Related articles

    Like to learn more? Here is a list of articles within the same category or having similar tags.

    Feedback

    Small picture of Michael Boelen

    This article has been written by our Linux security expert Michael Boelen. With focus on creating high-quality articles and relevant examples, he wants to improve the field of Linux security. No more web full of copy-pasted blog posts.

    Discovered outdated information or have a question? Share your thoughts. Thanks for your contribution!

    Mastodon icon