Why is ssh agent forwarding not working?
It turns out my key was not in the agent, and this fixed it:
You can list loaded keys using:
ssh-add -l ssh-add -L # for more detail
Another possible reason is connection sharing: one might already be logged in on the other host without agent forwarding and connection sharing enabled. The second login with
ssh -A (or equivalently specified in the config file) via the shared connection will silently ignore the
-A flag. Only after completely logging out or disabling connection sharing for second login, the agent forwarding will work.
Check if your
~/.ssh/id_ecdsafiles have the correct permissions which should be owned by your user and be chmoded 600.
Check that you have the correct public key on
pupeno/.ssh/authorized_keyson b1, and check if
authorized_keyshas a line break at the end of the key.
Check if you have ssh-agent running, try to load keys via
Try GSSAPI-based authentication and forwarding with
I had problem with sshd server rejecting agent forwarding request because of no space left in /tmp. This was because sshd needs to create socket in /tmp. Cleaning disk up resolved my issue.
ssh -v said back then:
debug1: Remote: Agent forwarding disabled: mkdtemp() failed: No space left on device
For the benefit of other googlers who also arrived at this question:
Incorrect whitespace in a ~/.ssh/config file can also cause some head scratching.
I recently helped out one of my co-workers who had this:
# incorrect host foobar ForwardAgent yes
instead of this:
# correct host foobar ForwardAgent yes
I've also run into instances where missing indentation of the directives under the list of hosts made a difference to functionality, even though it's not supposed to.