Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 11 of 16

Re: Git via SSH from Windows returns Permission Denied

I managed to finda solution. Looks like in Windows in the Git installation folder there's an ssh_config file where you can specify the key to be used for authentications:

 

1. Open  C:\Program Files\Git\etc\ssh\ssh_config (if that's where you installed Git)

2. Add lines

Host github.com

IdentityFile ~/.ssh/<your ssh key>

Ground Controller Lvl 1
Message 12 of 16

Re: Git via SSH from Windows returns Permission Denied

This worked for me, although I had to specify the absolute path for the key file (~ is not evaluating the home directory of the user in this case)

 

Of course, you shouldn't do this unless you're the only user on the system. I'd rather figure a better way to have Git provide information about what is going on with the SSH agent in this case (ie `git pull --verbose` tells me nothing about what is happening with the SSH session.

Highlighted
Ground Controller Lvl 1
Message 13 of 16

Re: Git via SSH from Windows returns Permission Denied

Thank you very much. It works for me.

Ground Controller Lvl 1
Message 14 of 16

Re: Git via SSH from Windows returns Permission Denied

solved by adding the environment variable GIT_SSH as c:\Program Files\PuTTY\plink.exe (installed putty before)

as somebody mentioned here git have problem with openssh

Ground Controller Lvl 1
Message 15 of 16

Re: Git via SSH from Windows returns Permission Denied

OK, this actually works here, too. OpenSSH works fine on Windows (I'm on Win10) but for some reason the Git version of SSH was highjacking things, and wasn't reading my identity file.

 

By adding this ENV (per user!) I was able to get it to look at my user's SSH credentials without overriding the global config for the Git SSH executable.

Ground Controller Lvl 1
Message 16 of 16

Re: Git via SSH from Windows returns Permission Denied

For The access Denied Issues And git username , password

I had this problem too but managed to solve it, the error is that ur computer has saved a git username and password so if you shift to another account the error 403 will appear. Below is the solution
For Windows you can find the keys here:

control panel > user accounts > credential manager > Windows credentials > Generic credentials

Next remove the Github keys.