GitHub Password Authentication Error Persist Despite Setting Up SSH Key

GitHub Password Authentication Error Persist Despite Setting Up SSH Key

Password deprecated - GitHub

ยท

3 min read

Table of contents

No heading

No headings in the article.

In December 2020, GitHub announced its non-support for password authentication with Git operations beginning on August 13, 2021. The deprecated password-authenticated method will no longer work and will be replaced with the following two methods.

  1. Personal Access Token Authentication Method

  2. SSH Key Authentication Method

This article is focused on the second method (SSH Key Authentication) Check out this youtube video I made on how to go about setting up the SSH Key and Adding it to the SSH agent

Note to Readers

I expect anyone reading this article to have basic knowledge about GIt & GitHub and he/she is experiencing difficulties performing Git operations (pushing to a repository) despite setting up the ssh-key and adding it to the ssh-agent

Why you still get the error

If you still can't push to a repository after setting up ssh-key authentication as a means to authenticate your Git operations then, this is because you're still working with/from an old remote origin (repository URL). (This won't happen if you working on a new repository after setting up the ssh key.) See the screen below to identify this error I am talking about.

mededit1.png

You notice the error from the screen above. I was trying to push and save changes I made to a repository but it won't work, still requesting the old deprecated password authentication method despite me setting up of ssh-key and adding it to the ssh-agent I am getting this error because I was trying to make changes (pushing) to an old remote origin. I was supposed to update my repository origin to the latest repository URL with the ssh-key configurations before doing this. The question is "How do I go about this"? Don't worry you're in the right place, we will be doing this in the next heading/paragraph.

How to update repository remote origin (URL) The next steps will walk you through how to update your repository remote origin or URL with ease.

  1. Firstly, we want to view our existing remotes origin using the below Git command
git remote -v

You should have a similar screen to the one below.

view remote.png

  1. Secondly, Let's update our repository origin. The below Git command will help us to do the trick.
git remote set-url origin [repository URL  here]

Exmaple: git remote set-url origin :stanflows/medncdmb.git

Let's verify our URL by repeating step one above.

origins.png

Great! You can see that our repository URL is now different from the previous screen at step one. This means everything is working out fine as expected. You can compare both screens to verify.

Testing Everything

If you're following up this article with a challenge to solve this error then, testing to see how everything will go is the best thing to do at this stage. I want to push to the same repository that gave me the error, I don't expect to have the error again because I have updated my repository URL on my local machine to the latest remote origin that has the ssh-key configurations.

finally.png

Wow! It worked. I was never prompted again to enter a username & password that will lead me to a deprecated password error or fail message screen on the terminal. ๐Ÿ˜‚

We did great! Congratulations on coming this far you're a champ. From now on if you have or see this error you now know why and what to do. Please leave some comments and likes below and don't forget to drop any error you're getting while following this article I will respond immediately.

๐Ÿ‘๐Ÿ‘๐Ÿ‘ ๐Ÿ˜Š๐Ÿ˜Š๐Ÿ˜Š

ย