Password authentication is temporarily disabled as part of a brownout. Please use a personal access token instead
GitGithubTokenGithub ApiGit PullGit 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
-
Generate a new token from GitHub's developer settings
-
Update the remote URL:
git remote set-url origin https://<token>@github.com/<Git_URL>
-
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
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:
I deleted (all) the row for GitHub
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.
And it started to work again.
Solution 3 - Git
Solution for macOS
I just followed the following instructions and that's solved my issue.
- Generate a personal access token for GitHub. Process to generate token
- Open your Keychain Access.
- Search for github.com and double click on that.
- 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 → Settings → Developer settings → Personal 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:
- Remove GitHub stored credentials from the keychain. (For example, using "Keychain Access" on Mac, or "Credential Manager" on Windows)
- Generate access-token from GitHub Settings → Developer Settings → Personal access tokens → Generate new token
- Save the token - as it will be available there for once only
- Run command
git fetch
(orgit 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 theremote: Password authentication is temporarily disabled
message, despite identical inputs. - 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) - 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:
- Generate access-token from GitHub: Settings → Developer Settings → Personal access tokens → Generate new token
- Update the URL for origin locally:
git remote set-url origin https://<token>@<git_url>.git
- Pull once:
git pull https://<token>@<git_url>.git
Solution 6 - Git
Works on macOS, Windows and Linux
Solution 1
-
Delete the existing repository (if you have any current changes, make a backup of it):
mv my-repo my-repo.backup
-
Create an SSH key and add it to GitHub (see GitHub documentation)
-
Clone the repository for SSH:
git clone [email protected]:group/repo-name.git
Solution 2 (recommended solution)
-
git remote remove origin
-
You have to add an access token (see GitHub documentation to generate a token)
-
git remote add origin https://<token>@<git_url>.git
-
git pull https://<token>@<git_url>.git
Visual Studio Code
Using- Remove your GitHub access:
git credential-osxkeychain erase
⏎ host=github.com
⏎ protocol=https
-
git push
orgit pull
It will prompt you with a modal dialog. Click Allow and follow the process.
Solution 7 - Git
If you're using macOS
-
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* → Settings → Developer settings → Personal access token.
-
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:
-
Click here and generate a personal access token. It's damn easy.
Now simply push it with the help of the PAT rather than password and username___________________
-
To push changes to your repository:
git push https://[Personal Access Token]@github.com/[User Name]/[Repository Name].git
Solution 10 - Git
-
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):
- Generate an SSH key with this guide: Generating a new SSH key
- Remove all old remotes that use HTTPS with
git remote remove origin
; - Add a new remote using an SSH reference (you can get it with the "code" button in your repository and then press "ssh").
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
- Go through this document to create a personal access token: Configuring two-factor authentication
Step 2: Replacing your previous cached password with the newly generated token
-
As answered here, you have to modify your local GitHub login credentials cached in your pc: https://stackoverflow.com/questions/15381198/remove-credentials-from-git
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:
-
Generate the personal access token (don't forget to copy the token)
-
Open your Keychain Access (Mac) or Credential Manager (Windows).
-
Update the GitHub password with the new personal access token in KeyChain Access/Credential Manager
-
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:
- What account do you want to log into? GitHub.com, choose GitHub
- What is your preferred protocol for Git operations? Choose HTTPS
- Authenticate Git with your GitHub credentials? Choose YES
- How would you like to authenticate GitHub CLI? Choose Login with a web browser
- Copy the code shown in terminal ->
B7C1-8E67
- Press Enter to open github.com in your browser
- 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, Settings → Developer Settings → Personal access tokens → Generate 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:
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.
- Generate an SSH key if you haven't by
ssh-keygen
and keep on hitting Enter till ends cat ~/.ssh/id_rsa.pub
- copy the result- Visit https://github.com/settings/keys
- Press New SSH Key and paste the key in the textbox. The title can be anything you want
cd <into your project's directory>
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:
- Generate a new token by following the official link
- 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)
Solution 24 - Git
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.