Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSH Forward Agent not working #815

Closed
hustlahusky opened this issue Aug 8, 2016 · 5 comments
Closed

SSH Forward Agent not working #815

hustlahusky opened this issue Aug 8, 2016 · 5 comments

Comments

@hustlahusky
Copy link

I'm setup ssh keys on bash on windows, like it works for me earlier on ubuntu. I use forward agent feature to access to git repos on server:

Host *
  ForwardAgent yes

Then I'm try execute ssh -T git@github.com on server and get this message:

Permission denied (publickey).

Instead of welcome message from github, like it works on local machine

@russalex
Copy link
Contributor

russalex commented Aug 8, 2016

Are you able to SSH into your server? There are some issues with firewalls and inbound connections. (Some conversations around inbound traffic on #722 but no real solution yet). I have not set up agent forwarding myself, but it's a likely first issue.

From the github Using SSH Agent Forwarding page:

Your server must allow SSH agent forwarding on inbound connections

Agent forwarding may also be blocked on your server. You can check that agent forwarding is permitted by SSHing into the server and running sshd_config. The output from this command should indicate that AllowAgentForwarding is set.

@jlecocq-kaliop
Copy link

Hi,
I have the same problem (not with github but with my webserver). My config : I just have a ~/.ssh/id_rsa as identity file. Here is my test environment :
my computer <== ssh ==> web server <== ssh ==> GIT Server
Here is my procedure :

  1. from bash on windows, I connect to the webserver : ssh -A user@website => OK
  2. I launch "git pull" command which uses ssh => got message "Permission denied (publickey)."

Also tried to add "ForwardAgent yes" into my .ssh/config file but same result.

With putty and agent forwarding activated, that test works very well.

I tried another way which seems to work : when I use the ssh-add command on bash on windows :
eval "$(ssh-agent)"
ssh-add /path/to/my/private/key
Then my test works.

I hope it will help you. I don't exclude a problem in my config but I don't see what's wrong.

@hempstutorials
Copy link

hempstutorials commented Aug 9, 2016

If you need help with ssh check out my blog it gives you all the ins and outs.

https://www.hempstutorials.co.uk/secure-shell-ssh-101

@hustlahusky
Copy link
Author

So, after some changes in local ssh configs, and automaticly adding ssh keys on bash on windows start, ssh agent forwarding works. Thanks to everyone!

@jiggneshhgohel
Copy link

Just in case anybody ends up here and finds that his problem is not resolved I would request you to refer the following related gist Windows 10 Linux Subsystem SSH-agent issues

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants