GitHub:- “Password Authentication is deprecated”

Background

Sometimes last week received an email from GitHub.

 

Email

Basic Authentication using a password to Git is deprecated

Image

Textual


Hi @DanielAdeniji,

You recently used a password to access the repository at DanielAdeniji/hello with git using git/2.29.2.windows.2.

Basic authentication using a password to Git is deprecated and will soon no longer work. Visit https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information around suggested workarounds and removal dates.

Thanks,
The GitHub Team

Explanation

Here is what is conveyed via email:-

  1. Repository Name
    • DanielAdeniji/hello
  2. Git Client Version
    • git/2.29.2.windows.2.
      • Git Client Version Number
        • 2.29.2
      • OS Version
        • Windows
  3. Notice
    • Basic authentication using a password to Git is deprecated

Goal

Our goal in this post is to determine if indeed the repository is currently configured for HTTP.

If it is configured for HTTP, then we are using password authentication.

And, in that case, we want to evaluate and explore the steps that we should undertake to have the particular repository use SSH keys.

 

TroubleShooting

Outline

  1. Git Commands
    • Git Remote

Tasks

Git Commands

Git Remote

Syntax

git remote -v

Sample

git remote -v

Output
Output – Image

Output – Text

>git remote -v
origin https://github.com/DanielAdeniji/hello (fetch)
origin https://github.com/DanielAdeniji/hello (push)

 

Explanation
  1. https://github.com
    • git
      • Using HTTPS
  2. DanielAdeniji
    • Organization
  3. Repository
    • hello

Remediation

Because git remote returns a URL, we need to change from HTTP to ssh.

Outline

  1. Git Commands
    • Git Remote
      • Git Remote set-url
      • Git Remote -v
    • Git Push
      • Git Push

Tasks

Git Commands

Git Remote
Git Remote Set-URL
Syntax

git remote set-url origin git@github.com:USERNAME/REPOSITORY.git

Sample

git remote set-url origin git@github.com:labOrg/dbWork.git

 

Git Remote -v
Syntax

git remote -v

Sample

git remote -v

Output – Text

>git remote -v
origin git@github.com:labOrg/hello.git  (fetch)
origin git@github.com:labOrg/hello.git  (push)

Explanation
  1. git@github.com
    • git
      • Using ssh keys
  2. DanielAdeniji
    • Organization
  3. Repository
    • hello.git

Git Push

Syntax

git push

Sample

git push

References

  1. Github.com
    • Using Git > Managing remote repositories > Changing a remote’s URL
      Link

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s