3

Im struggling with setting up ssh-agent-forwarding.

What I want to do: I want to have my public key on a ubuntu-server, the private key locally on my windows machine. I want to connect to the ubuntu-server without having to type in my private-key password since its stored in the pagent. This part works flawless. The next part is the one that isn't working though.

After connecting to the ubuntu-server I want to git/ssh into other servers, only with the key that is on my windows machine in the pagent.

What I've done so far: I have a Windows Client with installed pagent. The key is set up in the windows machine. I can connect to the ubuntu-server and authorize over the private key that I've set up. Also I have activated "Allow agent forwarding" in putty.

Thats what my ssh_config looks like:

Host *
   ForwardAgent yes

What the problem is: When connected to the server and typing in "ssh-add -l" the server tells me: "The agent has no identities."

What have I forgotten?

2 Answers 2

2

First, check that the server allows agent forwarding (AllowAgentForwarding in sshd_config) and if not, allow it and restart the sshd service. Then double check that it is really enabled in the PuTTY. If both of them is fine inspect the debug log from putty. If it forwarding failed, there must be some information why.

3
  • I keep seeing this suggestion everywhere (e.g. developer.github.com/v3/guides/using-ssh-agent-forwarding/…) but have been unable to find anywhere describe how to make my server allow agent forwarding. I'm using Ubuntu and OpenSSH and can't find instructions anywhere.
    – Ryan
    Nov 4, 2019 at 17:22
  • 1
    @Ryan open /etc/ssh/sshd_config on server and change AllowAgentForwarding to yes if it listed no. Then restart the ssh service. There is nothing more complicated in that. The logs are in /var/log/.
    – Jakuje
    Nov 5, 2019 at 11:35
  • Interesting. I'll try that. Thanks.
    – Ryan
    Nov 5, 2019 at 14:41
0

I've found my problem.

I had

eval $(ssh-agent)

in my .bashrc.

After deleting that line, the forwarding started to work.

1
  • Maybe you should delete the question due to "user confusion".
    – U. Windl
    May 18, 2021 at 6:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .