Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I would like to disable strict host key checking in ssh for ubuntu 11.04. How to do it?

share|improve this question
3  
Hi karthick87, I hope you understand the security implications of making that change ;) –  bodhi.zazen Dec 13 '11 at 16:18
add comment

4 Answers

up vote 27 down vote accepted

In your ~/.ssh/config (if this file doesn't exist, just create it):

Host *
    StrictHostKeyChecking no

This will turn it off for all hosts you connect to. You can replace the * with a hostname pattern if you only want it to apply to some hosts.

share|improve this answer
    
There is no file named config in my home directory. –  karthick87 Dec 14 '11 at 14:40
1  
Make one - the entire contents of the file are in my quote above. Note it's in the .ssh subdirectory of your homedir as well. –  Caesium Dec 14 '11 at 14:44
add comment

Rather than adding it to your ~/.ssh/config file for all Host *, it would be a safer to specify a particular host.

You can also pass a parameter on the command-line like this:

ssh -o StrictHostKeyChecking=no yourHardenedHost.com
share|improve this answer
    
Note that you generally only need to do this once per host since it says this the first time: Warning: Permanently added 'frxxx.blaps.net,10.11.12.13' (RSA) to the list of known hosts. –  MarkHu Jul 24 '13 at 0:49
add comment

FYI. I prefer to disable host checking just when using cssh.

alias cssh='cssh -o "-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"'
share|improve this answer
    
cssh or ssh? –  kenorb Jan 16 at 14:29
    
Maybe he uses cssh.sourceforge.net –  MarkHu Jan 31 at 3:22
add comment

I don't have the rep yet to comment above - but it's worth pointing out:

StrictHostKeyChecking no

will mean hostkeys are still added to .ssh/known_hosts - you just won't be prompted about whether you trust them, but should hosts change I'm willing to bet you'll get the big warning about it.

share|improve this answer
    
You're correct, you do get the big warning –  Freedom_Ben Jan 20 at 17:35
add comment

Your Answer

 
discard

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.