Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a router with a lot of computers on it. It has DHCP, so they are assigned IP addresses by the time they log in.

Because their IPs are shuffled every day, I get a lot of


messages from SSH.

Is there any way to tell ssh to ignore the man-in-the-middle security on all addresses in the 192.168.2.* range but keep the security for everything else?

share|improve this question

The best way to solve the problem would be to use names instead of addresses – a hostname always stays the same when the address changes. Some routers have DNS support built in (you could hook dhcpd into bind9 for DNS). Using Avahi for *.local names is also easy.

If you don't want that, you can tell SSH to never store the keys:

Host 192.168.2.*
    UserKnownHostsFile /dev/null
    StrictHostKeyChecking no

But IMHO that's just lazy. :)

share|improve this answer
That's handy - thanks! – Lester Cheung Dec 18 '12 at 5:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.