Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have two servers, with a common home directory, and therefore common ~/.ssh directories. I add my private key to the agent on my desktop.

In this way, I can ssh -A from desktop -> machine1a then to target machine passwordlessly. So far so good. Now I put another "machine-in-the-middle" in. I can so ssh -A from desktop -> machine1b then to target machine. However, on this last hop, SSH asks for the passphrase to my private key file. This is my problem.

I have tried setting "AllowAgentForwarding yes" in machine1b's /etc/ssh/sshd_config, but the man page states that the default is yes anyway.

I can see the following in the output of "ssh -vvv" on machine1a and machine1b:

debug1: Requesting authentication agent forwarding.
debug2: channel 0: request auth-agent-req@openssh.com confirm 0

The machines are identical OS's, and as I mentioned, the home directories are NFS-mounted on each machine so they too are identical. The permissions etc. of the .ssh directories and the files within seem to be OK - there are no error messages in the logs of the machine being logged into.

The last bit of output from machine1b when I do "ssh -vvv" is this:

debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>

It feels like something wrong with sshd on machine1b, but I can't find anything.

Does anybody have any other ideas?

share|improve this question
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.