Friday, September 12, 2008

Capistrano + Git: Host key verification failed.

Getting 'Host Key verification' failed when you're trying to do this? You might be trying to deploy source in a Git repo, and the Git repo is accessed via SSH.

cap deploy:cold


Do this: ssh into your target machine (the one codes getting deployed on), and then ssh into the Git repo machine -- or just do a 'git clone' if that's not possible. Accept the key, and then you're golden.

11 comments:

Helder Ribeiro said...

Every time I google for some crap capistrano throws at me I get sent here and find a great answer! Thanks a lot for sharing :)

Bet's On said...

No problem. :)

Fifi said...

so simple, I even did not think about this. Thanks!

Anonymous said...

This may seem obvious, but if your git repo is on the same machine as your deployment app, you have to ssh into whatever interface it is that is out on the 'net.

I tried to just ssh to localhost and added the key but that does not work.

Excellent post. Hopefully, some upcoming version of Capistrano will make it unnecessary. But for now, it sure saved me hours of headaches.

Tom said...

Thanks! that worked for me, too!

Anonymous said...

Great tip. Thanks a lot!

Anonymous said...

Great, this saved my day. Didn't understand why I got the error, cloned the repo and look, it's working! Thanks man!

Anonymous said...

If your git repo is on the same machine as your deployment app :

- ssh to this machine
- create a temporary directory
- execute "git clone user@this_machine:git/your_app.git
- accept the key

Your Capistrano deployment will know work smoothly!

Anonymous said...

You rocks !!! Thank you.

Anonymous said...

you realy realy save me after a lot of search

Jared said...

I use github or birbucket,but when i make a test connection by using the command "ssh -T git@github.com".it said "Host key verification failed", i could not find any solution, can you help me?