I've used the ssh-agent from oh-my-zsh to manage my SSH key. So far, so good, i only have to type the passphrase for my private key once when I start my shell and public key authentication works great.

The problem is however that key forwarding doesn't work. There are 2 servers A & B which I can use public key to login. When I ssh into A then from there ssh into B, I must provide my password, which should not be the case.

A is a CentOS 5.6 box, B is an Ubuntu 11.04 box. I have this on my local .ssh/config:

Host *
    ForwardAgent yes

OpenSSH on A is standard openssh 4.3 package provided by CentOS. I also enable ForwardAgent for ssh client on A, but forwarding still doesn't work.


Make sure AllowAgentForwarding is set to yes on the servers (sshd_config).

My guess is you are missing that.

Also forwarding is only on openssh 5.1+ So make sure you are running a valid version

  • 3
    I googled and openssh prior to 5.1 has agent forwarding enabled by default. AllowAgentForwardingg option is added to turn it on/off. – Lamnk Jun 8 '11 at 10:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.