Password authentication is temporarily disabled as part of a brownout. Please use a personal access token instead

GitGithubTokenGithub ApiGit Pull

Git Problem Overview


I was using a username password for pushing my code. It was working for several months, but suddenly I'm not able to do it and am getting this error:

Username for 'https://github.com': shreyas-jadhav
Password for 'https://[email protected]':
remote: Password authentication is temporarily disabled as part of a brownout. Please use a personal access token instead.
remote: Please see https://github.blog/2020-07-30-token-authentication-requirements-for-api-and-git-operations/ for more information.

Please note that the link doesn't help. Even using the generated token doesn't help.

> Moderator Note: This is part of a planned and soon-to-be permanent service change by GitHub

Git Solutions


Solution 1 - Git

  1. Generate a new token from GitHub's developer settings

  2. Update the remote URL:

    git remote set-url origin https://<token>@github.com/<Git_URL>
    
  3. Pull once:

    git pull https://<token>@<Git_URL>.git
    

And you are good to go.

Solution 2 - Git

The previously accepted answer, Kusal Shrestha's, does the job, but it is not safe because we store the token in plain text.

Storing it in the keychain is the better approach in my honest opinion.

For Visual Studio Code please read crg's answer.

For Windows:

You can try the @Venryx comment below, but I haven't tested it.


For Mac:

I just faced this issue now

Enter image description here

As suggested, I went to the development settings by following this URL and generated a token.

Then I went to my key chain access in my Mac:

Enter image description here

I deleted (all) the row for GitHub

Enter image description here

Now I went to the terminal and pushed dummy code

git push

Terminal asked me to enter the email and password for my account.

I entered my email, and, for the password, I entered the token that I generated earlier.

Enter image description here

And it started to work again.

Solution 3 - Git

Solution for macOS

I just followed the following instructions and that's solved my issue.

  1. Generate a personal access token for GitHub. Process to generate token
  2. Open your Keychain Access.
  3. Search for github.com and double click on that.
  4. Update the password with the key you've generated recently.

N.B: I'm not sure this will work for other operating system users.

Solution 4 - Git

Here is a simple solution:

  • Go to GitHub → SettingsDeveloper settingsPersonal access tokens. Regenerate your token and copy it.
  • On any of your local repositories, when git push, enter your username, and the password is the generated token

Instead of manually entering your token for every HTTPS Git operation, you can cache your token with a Git client.

  • In a terminal, enter the following:
# Set Git to use the credential memory cache
git config --global credential.helper cache
  • To change the default password cache timeout, enter the following:
# Set the cache to timeout after 1 hour (setting is in seconds)
git config --global credential.helper 'cache --timeout=3600'

Solution 5 - Git

Password authentication is disabled by GitHub and is not supported any more. Create and use a personal access token (PAT) instead of a password.

Steps to follow:

  1. Remove GitHub stored credentials from the keychain. (For example, using "Keychain Access" on Mac, or "Credential Manager" on Windows)
  2. Generate access-token from GitHub SettingsDeveloper SettingsPersonal access tokensGenerate new token
  3. Save the token - as it will be available there for once only
  4. Run command git fetch (or git push, if fetching doesn't require permissions) > If on Windows, you must run this from PowerShell, not the command prompt (CMD). The command prompt consistently fails with the remote: Password authentication is temporarily disabled message, despite identical inputs.
  5. It will ask for your user name and password. > If it does not ask you for your username and password, you must change your Git remote URL to contain your username: https://[email protected]/repo-owner/repo-name.git (see approach 2 for instructions on changing remote URL)
  6. Use the access token instead of the password when it asks for a password (you will have to enter it twice)

Or the second approach:

  1. Generate access-token from GitHub: SettingsDeveloper SettingsPersonal access tokensGenerate new token
  2. Update the URL for origin locally: git remote set-url origin https://<token>@<git_url>.git
  3. Pull once: git pull https://<token>@<git_url>.git

Solution 6 - Git

Works on macOS, Windows and Linux

Solution 1
  1. Delete the existing repository (if you have any current changes, make a backup of it):

    mv my-repo my-repo.backup
    
  2. Create an SSH key and add it to GitHub (see GitHub documentation)

  3. Clone the repository for SSH: git clone [email protected]:group/repo-name.git

  1. git remote remove origin

  2. You have to add an access token (see GitHub documentation to generate a token)

  3. git remote add origin https://<token>@<git_url>.git

  4. git pull https://<token>@<git_url>.git

Using Visual Studio Code
  1. Remove your GitHub access:
git credential-osxkeychain erase
⏎  host=github.com
⏎  protocol=https
  1. git push or git pull

    It will prompt you with a modal dialog. Click Allow and follow the process.

Solution 7 - Git

If you're using macOS
  1. First please delete all GitHub credential in the keychain and then please generate your token for use as your password instead (due to GitHub security policy): GitHub* → SettingsDeveloper settingsPersonal access token.

  2. Try to push or pull some things latest to/from your repository. Then Git will ask you for username and password. Enter your username and your generated token from GitHub.

Solution 8 - Git

If you are using HTTPS

  • Generate a token in your token settings as indicated in the documentation

  • If the repository already exists, you must then change your remote URL in the format: https://<username>:<token>@github.com/<repository_url>

    git remote remove origin
    git remote add origin https://<USERNAME>:<TOKEN>@<GIT_URL>.git
    git pull # Verify
    
  • If you clone your repository

    git clone https://<USERNAME>:<TOKEN>@<GIT_URL>.git
    

Solution 9 - Git

I tried every method, and finally it worked for me. I was unable to push in my repository because of this error, so please at least once try this!

_____________________________generate the personal access token:

  1. Click here and generate a personal access token. It's damn easy.

    https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token

    Now simply push it with the help of the PAT rather than password and username___________________

  2. To push changes to your repository:

    git push https://[Personal Access Token]@github.com/[User Name]/[Repository Name].git
    

Solution 10 - Git

  1. Create a personal access token

  2. On your Visual Studio Code command line:

    git config --global credential.helper [YOUR_TOKEN]
    

Solution 11 - Git

Solution for Ubuntu Server and an existing Git repository

Remove the password:

git config --global --unset user.password;
git config --local --unset user.password;

Change remote.origin.url. replace <username> by your GitHub username:

git config --global --replace-all remote.origin.url "https://<username>@github.com/PPEProjects/smile-eyes-be.git";
git config --local --replace-all remote.origin.url "https://<username>@github.com/PPEProjects/smile-eyes-be.git"

Pull/push

git pull
git push origin HEAD:develop

Enter the personal access tokens generated from Personal access tokens.

Solution 12 - Git

Try this (it worked for me):

  1. Generate an SSH key with this guide: Generating a new SSH key
  2. Remove all old remotes that use HTTPS with git remote remove origin;
  3. Add a new remote using an SSH reference (you can get it with the "code" button in your repository and then press "ssh").

enter image description here

Solution 13 - Git

First from the post: Token authentication requirements for API and Git operations, it said

> Mid-2021 – Personal access or OAuth tokens will be required for all authenticated Git operations.

So you need to use a personal access token (PAT) to push:

1 Get your personal access token

Login here to access the repository and add a new personal access token: Personal access tokens. Generate one and keep the token safe (it can't be shown once you leave).

(In Android Studio, you need to get the permission of "repo", "gist" and "read:org")

2 Push with the personal access token

After you get the token, you can push with a command like:

git push https://[personal access token]@github.com/[user name]/[repository Name].git

Solution 14 - Git

All you have to do is use a generated token instead of a traditional password:

Old method using a password:

git clone https://github.com/username/repo.git

Username: your_username
Password: your_password

New method using a token:

git clone https://github.com/username/repo.git

Username: your_username
Password: your_token

Step 1: Generating an API token from GitHub

Step 2: Replacing your previous cached password with the newly generated token

Solution 15 - Git

I received this error when trying to push up in Visual Studio Code... But I opened up Terminal and pushed up no problem using a username and password.

It might be something you could try.

Solution 16 - Git

This worked for me:

  1. Generate the personal access token (don't forget to copy the token)

  2. Open your Keychain Access (Mac) or Credential Manager (Windows).

  3. Update the GitHub password with the new personal access token in KeyChain Access/Credential Manager

  4. Last step: Do a Git clone (make sure you clone the repository in the proper directory location)

    git clone https://github.com/username/repo.git
    
    Username: your_username
    Password: your_token
    

In my case it did not prompt me for the username and password as it was already updated in Keychain Access.

Solution 17 - Git

GitHub is removing username password authentication

An alternative approach to what others have mentioned:

You can install and configure GitHub CLI. It is much better to set up using OAuth. There isn't any need to manually remove the credentials from the keychain.

On macOS with Homebrew (brew), the installation is even simpler:

Run brew install gh and follow the following:

  1. What account do you want to log into? GitHub.com, choose GitHub
  2. What is your preferred protocol for Git operations? Choose HTTPS
  3. Authenticate Git with your GitHub credentials? Choose YES
  4. How would you like to authenticate GitHub CLI? Choose Login with a web browser
  5. Copy the code shown in terminal -> B7C1-8E67
  6. Press Enter to open github.com in your browser
  7. Authenticate using the browser

Done.

Start using Git commands as you usually do.

Solution 18 - Git

The following steps worked perfectly fine for me

Steps to follow:

  • Generate an access token from GitHub, SettingsDeveloper SettingsPersonal access tokensGenerate new token

  • Save the token - as it will be available there for once only

  • Search for the .git-credential file in the system

  • Use the access token instead of the password in that file after the username.

Solution 19 - Git

There is also a very neat script that is helpful to convert HTTPS cloned Git repositories to use ssh protocol without removing and cloning the Git repository:

Convert HTTPS GitHub clones to use SSH

Solution 20 - Git

If you're using the HTTPS version instead of SSH one then this error will come because GitHub is removing the HTTPS method to maintain repositories.

  1. Generate an SSH key if you haven't by ssh-keygen and keep on hitting Enter till ends
  2. cat ~/.ssh/id_rsa.pub - copy the result
  3. Visit https://github.com/settings/keys
  4. Press New SSH Key and paste the key in the textbox. The title can be anything you want
  5. cd <into your project's directory>
  6. git remote set-url origin [email protected]:<username-here>/<repository-name-here>.git

And you're good to go!

Solution 21 - Git

You can generate your PAT (personal access token) via your GitHub dashboard.

  • Step 1: Log in to your GitHub account.

  • Step 2: In the upper-right corner of any page, click your profile photo, then click Settings.

  • Step 3: In the left sidebar, click Developer settings.

  • Step 4: In the left sidebar, click Personal access tokens.

  • Step 5: Click Generate new token.

  • Step 6: Give your token a descriptive name.

  • Step 7: Select the scopes, or permissions. You'd like to grant this token. To use your token to access repositories from the command line, select repo.

  • Step 8: Click Generate token.

Copy your token to a safe location as once you get out of that page you will not be able to retrieve it, unless you create a new one.

Solution 22 - Git

You don't need to remove the remote. Add a new one and then pull (as suggested by the accepted answer).

The simplest solution that worked for me (on Linux) was to use gh auto login and follow the CLI instructions. No further steps were required.

If you don't have gh, install it following this link, depending on your OS.

Solution 23 - Git

If you don't want to store your token in plain text (by modifying the remote repo's URL), you can do this:

  1. Generate a new token by following the official link
  2. Make sure you copy the token by clicking on the following button. If you double click on the text and copy it, it will add an extra space and you'll keep getting the same error (even though you're not using your password anymore, but the token)

enter image description here

Solution 24 - Git

Fast hot fix

Go to Personal access tokens and regenerate the last token:

Enter image description here

Solution 25 - Git

I faced this problem this afternoon and solved it by replacing my GitHub password on my computer as described in reference 3 with generated token from reference 2.

  • Reference 1: See Token authentication requirements for API and Git operations. The password is not supported anymore.

  • Reference 2: So you should generate a token with this tutorial and use it to replace your password as a credential.

  • Reference 3: If you are not prompted for your username and password, your credentials may be cached on your computer. You can update your credentials in the Keychain to replace your old password with the token as described in this tutorial.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionShreyas JadhavView Question on Stackoverflow
Solution 1 - GitKusal ShresthaView Answer on Stackoverflow
Solution 2 - GitNagaraj AlagusundaramView Answer on Stackoverflow
Solution 3 - GitSifat HaqueView Answer on Stackoverflow
Solution 4 - GitdpacmanView Answer on Stackoverflow
Solution 5 - GitAvneesh AgrawalView Answer on Stackoverflow
Solution 6 - GitcrgView Answer on Stackoverflow
Solution 7 - GitivrylobsView Answer on Stackoverflow
Solution 8 - GitE-jarodView Answer on Stackoverflow
Solution 9 - GitSaikat MukherjeeView Answer on Stackoverflow
Solution 10 - GitJaeyoung0View Answer on Stackoverflow
Solution 11 - GitTien NguyenView Answer on Stackoverflow
Solution 12 - GitAlfonso TesoneView Answer on Stackoverflow
Solution 13 - GityellowgrayView Answer on Stackoverflow
Solution 14 - GitBlaze CloneView Answer on Stackoverflow
Solution 15 - GitJ FView Answer on Stackoverflow
Solution 16 - GitYeshiView Answer on Stackoverflow
Solution 17 - GitAmir SaleemView Answer on Stackoverflow
Solution 18 - Gitpshrimal000View Answer on Stackoverflow
Solution 19 - GitRemoView Answer on Stackoverflow
Solution 20 - GitYash PokarView Answer on Stackoverflow
Solution 21 - Gitstanley mboteView Answer on Stackoverflow
Solution 22 - GituberView Answer on Stackoverflow
Solution 23 - GitOscar MederosView Answer on Stackoverflow
Solution 24 - GitPetrView Answer on Stackoverflow
Solution 25 - GitLebeccaView Answer on Stackoverflow