Capistrano deploy ** Host key verification failed

danhere picture danhere · Oct 23, 2011 · Viewed 14k times · Source

I've followed several suggestions from other sites but to no avail. When I try cap deploy:cold I consistently get "Host key verification failed."

I've tried everything. I've ssh'd from my computer to the remote, removed and readded both keys from known-hosts, cloned from github, set up my public key from both the server and local on github.

What am I missing here?


Capfile: https://gist.github.com/1308243


Errors: https://gist.github.com/1308255

Answer

Rex picture Rex · Feb 23, 2012

Add to your deploy.rb:

ssh_options[:forward_agent] = true
default_run_options[:pty] = true

Or log in to the server(s) you are deploying to (as your deploy user) and run:

ssh [email protected]
The authenticity of host 'github.com (207.97.227.239)' can't be established.
RSA key fingerprint is **:**:**:.
Are you sure you want to continue connecting (yes/no)? yes

Most of the time I see this issue is when github.com in not in your ~/.ssh/known_hosts