You're viewing a post from the archive. Don't forget to checkout our latest post Let them eat State

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.