I recently switched from the regular Lubuntu LXDE/openbox to the i3 window manager under Lubuntu 16.04.

In either environment I can ssh with authentication forwarding activated into another machine via a vpn tunnel using:

ssh -A user@remote-machineA

On my local machine I have a ssh key for a git repository on remote-machineB. I can access the repository fine while on remote-machineA with LXDE but get a "Permission denied" using i3 to start with. Assuming my i3 does not forward keys like LXDE does. But I don't know what the missing piece is.

I came across this: https://www.reddit.com/r/i3wm/comments/4ho1qj/sshagent_within_i3wm_on_ubuntu_1604_does_not_work/

But unsure if this is the same problem as I experience, I tried the solutions proposed there but to no avail.


Certain DE environments starts their own applications that can behave as a ssh-agent and that can be forwarded. But it is not probably the case for the i3. If you want to use "ssh-agent forwarding" (it is not "authentication forwarding" as you note), you need to have ssh-agent running and your keys loaded inside. You can verify that simply using command below. It should list your authentication keys

ssh-add -l

If it returns error, you need to start the agent first:

eval `ssh-agent`

If it does not list them, you need to add the keys to the agent:

ssh-add path/to/key

If you want to automate it, add these commands to your .bashrc (do not start new agent with every bash! Only if there is no ssh-agent connection yet). There is a lot of snippet you can use all over the internet.

  • Thank you very much, ssh-add mykey solved it :) – some user Jun 13 '16 at 18:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.