Home > OS >  Can't authenticate to Github with git
Can't authenticate to Github with git

Time:11-12

Sorry if the question is not well written, I'd rather explain it. Everything was working fine, and all of the sudden I get an error every time I do a git push. I've tested my ssh key, and it seems to be working, so I do not know what is going on.

Here is what happens from VSCode integrated terminal:

ssh -T [email protected]
Hi duke33!! You've successfully authenticated, but GitHub does not provide shell access.

then when I try to push a commit:

git push
remote: No anonymous write access.
fatal: Authentication failed for 'https://github.com/duke33/SPRINT2-ITAcademey.git/'

If y try to the same from Linux mint terminal, I get the same message for ssh -T [email protected] , and when I push, I push:

Username for 'https://github.com': duke33
Password for 'https://[email protected]': 
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: Authentication failed for 'https://github.com/duke33/SPRINT2-ITAcademey.git/'

I do not know how to tackle this issue. Hope someone can help me out!

PD: I've tried ussing a token for authentication, but I would like to fix this with ssh.

PD2: The authentication was working with shh, but now it does not, even though the shh is valid and configured on git hub!

CodePudding user response:

You are using https remote. Change to ssh.

git remote set-url origin [email protected]:duke33/sprint2....git
  • Related