Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 972
Shreyas Jadhav Avatar asked Oct 08 '22 01:10

Shreyas Jadhav


People also ask

How do I enable my personal access token?

From your home page, open user settings , and then select Personal access tokens. Select + New Token. Name your token, select the organization where you want to use the token, and then set your token to automatically expire after a set number of days.

How do I find my personal access token?

Under your GitHub user profile (not the repository profile), click the “Settings” link. Scroll down and click the “Developer Settings” link. Click the GitHub “Personal access tokens” link.

Is it possible to disable password authentication in Git brownout?

git - Password authentication is temporarily disabled as part of a brownout. Please use a personal access token instead - Stack Overflow Password authentication is temporarily disabled as part of a brownout. Please use a personal access token instead [duplicate] Closed last year. I was using a username password for pushing my code.

Why is password authentication disabled for HTTPS private repository?

1 remote: Password authentication is temporarily disabled as part of a brownout. Please use a personal access token instead As Github has removed password authentication for HTTPS private repository, to perform git operations like pull, push, clone you have to use Personal Access Token instead of password.

How do I get access token instead of password?

Use the access token instead of the password when it asks for a password (you will have to enter it twice) Generate access-token from GitHub: Settings → Developer Settings → Personal access tokens → Generate new token This worked for me just now, not sure why it's being downvoted.

Why on Earth is the word 'brownout' used?

The problem is, even using a generated token as a password, the same error message appear. Why on earth is the word "brownout" used?? @RossPresser A "brownout" is where you lose some, but not all, power. It's a throwback to the era of incandescent bulbs, where a small power loss could cause the bulbs to noticably dim.


Video Answer


8 Answers

  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.

like image 199
Kusal Shrestha Avatar answered Oct 21 '22 03:10

Kusal Shrestha


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.

like image 30
Nagaraj Alagusundaram Avatar answered Oct 21 '22 03:10

Nagaraj Alagusundaram


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.

like image 25
Sifat Haque Avatar answered Oct 21 '22 04:10

Sifat Haque


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'
like image 43
dpacman Avatar answered Oct 21 '22 04:10

dpacman


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
like image 25
Avneesh Agrawal Avatar answered Oct 21 '22 03:10

Avneesh Agrawal


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.

like image 16
ivrylobs Avatar answered Oct 21 '22 03:10

ivrylobs


Works for 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

Solution 2 (recommended solution)

  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.

like image 19
crg Avatar answered Oct 21 '22 04:10

crg


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
    
like image 12
Saikat Mukherjee Avatar answered Oct 21 '22 03:10

Saikat Mukherjee