Git error: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.

Answered
yaboy01 asked this question 11 months ago
yaboy01 on Mar 12, 2022

When cloning a private repository, I recently got this error message after typing in my password:

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/username/my_repo_name.git/'

How do I clone this repository? I need to configure password authentication token somehow?

Thanks!

4 suggested answers
nick on May 7, 2022 · Edited

GitHub no longer accepts password authentication and now uses what's called a Personal Access Token.

This is a token that you generate on GitHub that is tied to your account. Then when you do operations like cloning and pushing, Git will use that token for authentication instead of using a password.

So, first you need to generate a Personal Access Token in your GitHub account.

Here's the steps to do that:

  1. Go to the Developer settings section of your GitHub account.
  2. Open the Personal access tokens page.
  3. Click the Generate new token button.
  4. Give your token a label to help you remember what its for and add an expiration date.
  5. Select your preferred scopes.
  6. Generate the token.
  7. Copy the token and save it in a secure location on your machine.

Clone your repository again and use your Personal Access Token when prompted.

Everything should go smoothly now.

Git should cache your personal access token so you shouldn't have to re-enter it going forward (until it expires).

0 replies
coderguy on May 7, 2022

You need to create a personal access token on GitHub and then use that instead of your password.

The link in your terminal output gives more context for why GitHub switched to that method: https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/.

Generate the token on GitHub, save it locally somewhere on your machine, and then use it instead of your password when cloning, pushing, etc. your repository.

Easy peasy!

0 replies
rusty1_rusty1 on May 7, 2022

Generate a new token in the Developer settings section of your GitHub.com account. And save the token somewhere on your local machine.

Then update the remote URL for your Git repository:

git remote set-url origin https://<token>@github.com/<username>/<repo>

Replace <token>, <username>, and <repo> in that command with your own credentials.

0 replies
looper003 on May 7, 2022

Generate a personal access token in your GitHub account

Go to the **Developer settings` section of your GitHub.com account and generate a new token.

Make sure you save the token somewhere on your machine. You can only access it the one time in your GitHub account.

Configure GitHub to use the token on your local machine

Windows:

  1. Open Control Panel => User Accounts => Credential Manager.
  2. Find git:https://github.com.
  3. Click Edit.
  4. Replace the password with the GitHub Personal Access Token you generated.

MacOS:

  1. Open Spotlight Search and search for Keychain Access.
  2. In Keychain Access, search for github.com.
  3. Update the internet password entry for github.com.
0 replies
Answered