Last Updated: February 25, 2016
·
571
· dnene

Disable host checking on local network

SSH is a great tool, but its host checking on local networks run on DHCP soon becomes a pain. Thats because nodes on the network change their IP addresses and the knownhosts file becomes stale, and checking knownhosts soon results in SSH commands not going through until you edit or just delete the known_hosts file.

A easy way to disable host checking on local network is as follows. Create an entry in your ~/.ssh/config as follows (replace 192.168.1.* with your local network IP range). And voila host checking issues are a thing of the past

Host 192.168.1.*
    StrictHostKeyChecking no
    UserKnownHostsFile /dev/null

Of course you will always see the following message coming up. But you can safely ignore it since the value is going to /dev/null

Warning: Permanently added '192.168.1.NNN' (RSA) to the list of known hosts.

I've been using this for a couple of weeks, and it is a great relief.

Reference: http://linuxcommando.blogspot.in/2008/10/how-to-disable-ssh-host-key-checking.html