Reputation: 821
I ran through the whole process of adding a key to Github and doing everything on this guide that Github provided, but afterwards, it asked every 5 min for the ssh passkey, which is quite annoying while working on a project, so a found a command that eases that but this morning I got an error saying the following
C:\Windows\System32\OpenSSH\ssh.exe: C:WindowsSystem32OpenSSHssh.exe: command not found
reran this to check if everything was fine
$ ssh -T [email protected]
it authenticated, but the error did not disappear, so I ran the same command that I got on Friday git config --global --add core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe
Now when I do a 'refresh' (push and pull) to get the latest changes to my repo, it just keeps on synchronizing changes as if it is infinite looping and then timing out.
Edit***
If I run git pull in git bash I get the following output
$ git pull
CreateProcessW failed error:193
ssh_askpass: posix_spawnp: Unknown error
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
but before that, I ran ssh -T [email protected]
and I got the following output after entering the password
Hi Faziki! You've successfully authenticated, but GitHub does not provide shell access.
Does anyone know what I can do to fix this ?
Upvotes: 1
Views: 1164
Reputation: 1323753
The idea is to not use anything from Windows itself, but only from your Git for Windows (make sure to get the latest 2.33.0.2)
So remove any ssh setting from your global Git configuration, and make sure your %PATH%
includes:
set GH=C:\path\to\git
set PATH=%GH%\bin;%GH%\usr\bin;%GH%\mingw64\bin;%GH%\mingw64\libexec\git-core;%PATH%
A where ssh
in a CMD should give you: C:\path\to\git\usr\bin\ssh.exe
.
From there, from that same CMD, you can type "bash" to switch to a bash shelll session.
Make sure your ~/.bashrc
automatically launch the ssh agent.
And add your private key to the agent: that will cache the passkey.
Upvotes: 2