Https access, but not ssh

Im having some trouble accessing repo’s via ssh getting the following error.

Facts:

  • I successfully authenticate via ssh to git with ssh -vT git@github.com
  • I can successfully clone via https, so permissions should be ok.
  • I’ve created a new ssh key, added to ssh-agent and added to my user profile.
  • I’ve tried both with a RSA and ED25519 key.

Any idea what could be wrong? Any information is greatly appreciated.

I looked at your account and can see that the repository is public, so (oddly) that looks like authentication fails altogether. You could run the Git command with GIT_SSH_COMMAND="ssh -v" to get debug output, and compare with the ssh -vT git@github.com output, especially regarding authentication (e.g., are they using the same key?).

Setting up verbose logging for ssh, showed the error. For some reason git looks at y:.ssh and not C:\users<username>.ssh where the actual ssh keys are located (Windows). The y: drive is a company assigned drive - haven’t figured out why git has this behavior.

Thanks for the hint!

1 Like