dmac / fezzik

A light deployment system that takes care of the heavy lifting.
https://rubygems.org/gems/fezzik
MIT License
37 stars 6 forks source link

Optionally add unknown ssh hosts to known_hosts file #6

Open philc opened 13 years ago

philc commented 13 years ago

If you've never ssh'd into a host before and you begin deploying with fezzik to that host, you will get a confirmation message asking you to add it to the list of known hosts. Since fezzik isn't accepting keyboard input, the deploy hangs there.

Here's a reference for implementing workaround: http://www.sharms.org/blog/2009/01/mass-adding-hosts-to-ssh-known_hosts-file/

One thing that's unclear about this addition is how "optionally" should be implemented in fezzik. Maybe an "add hosts to deploy target" global option in deploy.rb?

edanaher commented 13 years ago

A much simpler (though less secure) way to do this is to tack on -oStrictHostKeyChecking=no to the ssh connection. This will cause ssh to automatically add new hosts.

Unfortunately, it will also ignore changed host keys, so intercepting traffic becomes much easier. You do still get the giant WARNING, and "Password authentication is disabled to avoid man-in-the-middle attacks."