-1

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 git@github.com
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 git@github.com , and when I push, I push:

Username for 'https://github.com': duke33
Password for 'https://duke33@github.com': 
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!

Mariano
  • 65
  • 9
  • 3
    The error output from your terminal is telling you what's wrong. Password authentication is no longer valid and your git appears to be setup to use password authentication. As you said, you can paste a token instead of a password and that will work fine. If you want to use SSH, you need to reconfigure your authentication to use SSH instead of password verification. Does this answer your question: https://stackoverflow.com/questions/14762034/push-to-github-without-a-password-using-ssh-key – waykiki Nov 11 '21 at 11:35
  • 3
    You are using `https` remote. Change to ssh. `git remote set-url origin git@github.com:duke33/sprint2....git`. Also gitlab != github, why did you ask on gitlab? – KamilCuk Nov 11 '21 at 11:50
  • I don't understand if I would have to do that for each every repository that I have. Can't it be done like for the whole github? – Mariano Nov 11 '21 at 12:06
  • 1
    Yes, you need to do that for (every remote of) every repository. – dan1st Nov 11 '21 at 12:09
  • Well, now it is working. Thank you all. This is a new hassle. The way it was set up with https remote I did not have to go trough this extra step, and now I have to. – Mariano Nov 11 '21 at 12:18
  • @KamilCuk , woul you post it as an aswer so I can mark it as solved? – Mariano Nov 11 '21 at 12:21
  • Does this answer your question? [Push to GitHub without a password using ssh-key](https://stackoverflow.com/questions/14762034/push-to-github-without-a-password-using-ssh-key) – Felipe Andrade Feb 06 '22 at 08:38

1 Answers1

2

You are using https remote. Change to ssh.

git remote set-url origin git@github.com:duke33/sprint2....git
KamilCuk
  • 120,984
  • 8
  • 59
  • 111