SSH Agent Forwarding Not Working

Peter Moody mindrot at
Thu Jul 12 13:52:16 AEST 2018

> However, the forwarding doesn't seem to be actually working - "ssh -T
> git at" works locally, but not if I run it on the server
> (machine B). `ssh-add -l` prints fine locally, but prints "The agent
> has no identities" on the server.

it sounds like something on B is running a new ssh-agent process when
you log in.

when you ssh to B, is your $SSH_AUTH_SOCK owned by 'sshd' or
'ssh-agent'? if you've forwarded your agent, it should be owned by
sshd on the remote host.

this is good:

$ sudo lsof -n | grep $SSH_AUTH_SOCK
sshd       71286            pmoody   10u     unix 0xffff8802058a9400
     0t0  741054208 /tmp/ssh-9bmDCfYasv/agent.71286


$ eval `ssh-agent`
Agent pid 72317
$ sudo lsof -n | grep $SSH_AUTH_SOCK
ssh-agent  72317            pmoody    3u     unix 0xffff880031322800
     0t0  741071876 /tmp/ssh-tc6wDsKNfgFi/agent.72316

More information about the openssh-unix-dev mailing list