What username and password does ksshaskpass require?

Viewed 32

I am trying to connect to github using shh:

git push -u myDoks main

and a popup box from ksshaskpass is asking 'Username for https://github.com'

I have tried entering my email, or my username, and then am asked 'Password for https://myusername@github.com' but after entering my github password I am told the authentification failed. What am I doing wrong?

1 Answers

First, this is not related to SSH, since Git is asking credentials to an HTTPS URL. For SSH, see your previous question.

Second, try to enter:

  • your Github username account (not email: your GitHub login)
  • your GitHub token (a PAT: Personal Access Token, created with scope repos)
    Since Aug. 2021, GitHub no longer accepts account passwords when authenticating Git operations on GitHub.com.

Finally, make sure you have set a credential helper to cache said credentials.

git config --global credential.helper

On Windows, GCM is already installed (Git Credential Manager from Microsoft, cross-platform: you can install it on Mac or Linux).

git config --global credential.helper manager-core

You can then register your token (cache it in the underlying credential vault used by GCM), even on Windows, even in a simple CMD (you don't even need a git bash session):

printf "host=github.com\nprotocol=https\nusername=YourAccount\npassword=YourToken" | git credential-manager-core store

That way, Git won't ask you again for your credentials on the next git push.

Make sure:

  • <path/to/Git>/mingw64/bin is in your %PATH%/$PATH: that is where git-credential-manager-core will reside (for recent Git versions anyway 2.35+).
  • <path/to/Git>/bin/bin is in your %PATH%/$PATH: that is where printf will reside (needed for Windows OS which does not have a built-in shell printf command in its shell).
Related