Created
March 8, 2012 10:48
-
-
Save joho/2000371 to your computer and use it in GitHub Desktop.
Fix 'Host key verification failed.' errors by using this cap task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this to your capfile if you're getting burned on first deploy to a new host | |
# If you're getting 'Host key verification failed.' errors on your initial | |
# checkout of a repo using capistrano, this will fix it up | |
task :a_friend_of_mine_is_a_friend_of_yours do | |
# transfer what *I* know about github to the host | |
github_known_hosts_line = `cat ~/.ssh/known_hosts | grep github.com` | |
run "echo #{github_known_hosts_line} >> ~/.ssh/known_hosts" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment