New bamboo web development

Bamboo blog. Our thoughts on web technology.


Solving a Problem of Non-Working Key Forwarding With Capistrano

over 2 years agoby Bartosz Blimke

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

1 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:

1 #Host *
2 #ForwardAgent no
to the following two lines:
1 Host *
2 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:

1 ssh-add ~/.ssh/id_dsa

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

Now everything works fine.