I receive a Could not open a connection to your authentication agent
error message when I attempt to connect from an intermediate server to a third server using the agent forwarding option (-A
) of an OpenSSH client. The first connection to the intermediate server goes smoothly using a key loaded into ssh-agent
. The error message is displayed when attempting a connection to the final server.
My OpenSSH client is set to allow forwarding with ForwardAgent yes
in ~/.ssh/config
, and the intermediate server has AllowAgentForwarding yes
in the daemon's configuration file. The client config is not overridden by a system level file.
I'm not using a terminal multiplexer in order to avoid an error stemming from environment variables not being set. To run the agent, I use exec ssh-agent zsh
and verify that both SSH_AUTH_SOCK
and SSH_AGENT_PID
are present in the local environment. I use ssh-add
to add the private keys for the intermediate and final server, respectively; I verify they are added with ssh-add -l
.
All servers are of a recent version (OpenSSH 5.3) and the client is OpenSSH 6.2.