Home > Blockchain >  Git does not use SSH key for Github (Mac OS)
Git does not use SSH key for Github (Mac OS)

Time:10-02

I am trying to setup my git to let me clone/push/pull/... from and to GitHub in the terminal without entering my Username and Password, but I am getting this error:

❯ git clone https://github.com/Johannes-Krabbe/private-repo.git
Cloning into 'private-repo'...
Username for 'https://github.com': Johannes-Krabbe
Password for 'https://[email protected]':
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/Johannes-Krabbe/private-repo.git/'

I followed both of the following tutorials:

When I run ❯ ssh -T [email protected] I get this output:

Hi Johannes-Krabbe! You've successfully authenticated, but GitHub does not provide shell access.

CodePudding user response:

When using git via ssh you cannot use https:// URLs, but specific ssh addresses instead. In your case use [email protected]:Johannes-Krabbe/private-repo.git to access your repository.

  • Related