Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

'Git' Not Authenticating due to Password Authentication Being Removed

I need to push a cloned repo back to Github, but when I run git push -u -f origin main in the folder that I’ve initialized and added a remote origin to, it returns this error:

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/BusyBird15/WeatherOne.git/'

How do I authenticate myself when the main authentication method has been removed?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The main authentication method for GitHub is SSH, which you can read about in their documentation: https://docs.github.com/en/authentication/connecting-to-github-with-ssh

As a summary, partially taken from GitHub own documentation, you should:

  1. Generate a SSH key, using for it a command like: ssh-keygen -t ed25519 -C "your_email@example.com"
  2. If using linux, modify the permissions of the key files with chmod 600 keyFile
  3. Add the key to your GitHub profile, under Settings -> SSH keys
  4. Add the key to your git installation, with ssh-add ~/.ssh/id_ed25519

You’ll have to then adjust your origins to point to the ssh endpoints of your repository. The one you linked would be: git@github.com:BusyBird15/WeatherOne.git

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading