Jindrich Vavruska
Jindrich Vavruska

Reputation: 832

How to force git use SSH authentication?

I have a problem with GIT.

  1. Remote URL is [email protected]:jvavruska/log73r.git
  2. I have my key pair set up and public key registered at gitlab.com
  3. ssh -T [email protected] returns:
    Welcome to GitLab, @jvavruska!
  1. but when I try git push, git push origin master, etc. it always returns
   FATAL ERROR: No supported authentication methods available (server sent: publickey)
   fatal: Could not read from remote repository.

   Please make sure you have the correct access rights
   and the repository exists.

I could not anything in the Git documentation to explain how to force git use SSH for authentication. No CL option, just nothing...

My %USERPROFILE%\.ssh\config:

Host gitlab.com
  Preferredauthentications publickey
  IdentityFile C:\Users\jvavruska\.ssh\id_ed25519

Upvotes: 2

Views: 4458

Answers (1)

Jindrich Vavruska
Jindrich Vavruska

Reputation: 832

I am sorry and I apologize. Stupid mistake: GIT_SSH variable was set to .... plink.exe. Most likely my older, previous setup (which should work with the existing .ppk file, but for some reason didn't). I changed GIT_SSH=ssh (yes, without path!) and immediately everything started moving in the right direction. Once more, sorry.

Upvotes: 4

Related Questions