SSH Agent Forwarding not working even when using `ssh -A`
Solution 1:
I've been trying to troubleshoot this problem for nearly seven
years, and finally it get solved -- I launch keychain
in my ~/.profile
, which starts its own 'ssh-agent
', even on machine B & C. This is the source of the problem, because keychain
's ssh-agent
overshadow the sshd
provided one.
Removing it (keychain
) from my ~/.profile
solved the problem.
Update, another possibility, ssh-agent
etc. usually get started as part of starting up the GUI on the local system. e.g., in another case, the call's hidden in /etc/X11/xdm/sys.xsession
!
I confirm my SSH Agent Forwarding is working by doing, in MachineA,
ssh -t MachineB ssh MachineC
while ssh MachineB
then, within it ssh MachineC
was failing.
I'll start it (ssh-agent
from keychain
etc) manually only from machine A from now on.