Bambinos RSS

New Bamboo

Bamboo Blog

Archive

Nov
1st
Sun
permalink bartoszblimke

Solving the problem of non-working key forwarding with Capistrano

After I upgraded my Mac to Snow Leopard, Capistrano deployments with key forwarding stopped working. I started getting a following error:

Permission denied (publickey).

My fellow Bambinos enlightened me that key forwarding was switched off by default in Snow Leopard. The solution was to change the following two lines in /etc/ssh_config:

#Host *
#ForwardAgent no

to the following two lines:

Host *
ForwardAgent yes

Unfortunately after this change I was still getting Permission denied (publickey) error.

Today I found the root cause. My ssh key was not added to the authentication agent so the key was not forwarded. The solution was to execute the following command:

ssh-add ~/.ssh/id_dsa

(or ssh-add ~/.ssh/id_rsa if you use rsa key)

Now everything works fine.