“This is the third day of my participation in the August More Text Challenge.
origin
I encountered this error when SUBMITTING code to GitHub last night.
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
Your old password certificate will no longer be available on August 13, 2021, and you will have to use a Personal Access token instead of your password.
I’ve heard about this mechanism before, and GitHub often sends email reminders to switch to it. I was too lazy to do it, so I used the same password to log in, and this time I was caught off guard.
motivation
Here are GitHub’s motivations for switching to token:
We described our motivation as we announced similar changes to API authentication.
In recent years, GitHub customers have benefited from many of GitHub.com’s security enhancements, such as two-factor authentication, login alerts, authenticated devices, protection against the use of compromised passwords, and WebAuthn support. These features make it harder for an attacker to get a password that is reused on multiple sites and use it to try to access your GitHub account. Despite these improvements, customers who have not enabled two-factor authentication for historical reasons have been able to continue authenticating Git and API operations using only their GitHub username and password.
Starting August 13, 2021, we will no longer accept account passwords for authenticating Git operations and will require token-based authentication, Examples are personal access tokens (for developers) or OAuth or GitHub application installation tokens (for integrators) for all authenticated Git operations on GitHub.com. You can also continue to use SSH keys where you like.
benefits
Tokens offer a number of security advantages over password-based authentication:
-
Uniqueness: Tokens are GitHub specific and can be generated by usage or by device.
-
Revocable: The token can be revoked individually at any time without updating unaffected credentials.
-
Finiteness: Tokens can be narrowed down to allow only the access required by the use case.
-
Randomness: Simpler passwords that the token does not need to remember or enter regularly can be affected by dictionary types or brute force attempts.
measures
The first step
Visit Github and log in to your Github account. Click on your picture in the upper right corner, find Setting in the drop-down menu, and then click on it.
The diagram below:
The second step
Then click the Developer Settings option in the left pane.
The third step
Click on the Personal Access Tokens option on the left side and see the picture below:
Then, click the Generate New Token button in the upper right corner.
The fourth step
Verify information.
Step 5
As shown in the following figure, the setting page is displayed.
- Note
Verify the title (alias) of the token. You can give it a memorable name.
- Expiration
Verify the validity period of the token (mandatory). The default value is 30 days.
- Select scopes
Select the scope or authority to grant this token token. To use the token to access the repository from the command line, select REPo. To use token to delete the warehouse from the command line, select delete_repo. Select others as required.
Finally, click the Generate Token button.
Step 6
As shown in the figure below, the Token Token was successfully generated.
Note that please copy it and save it, because when you refresh the page again, you won’t be able to see it anymore.
Step 7
There are two ways.
- Then log in with your generated token and paste the generated token into the password.
If the password input option does not appear in the push operation, please enter the following command first, and then you can see the password input option.
git config --system --unset credential.helper
Copy the code
- Add the token directly to the remote repository link, so that the same repository does not have to enter the token every time it submits code:
git remote set-url origin https://<your_token>@github.com/<USERNAME>/<REPO>.git
Copy the code
<your_token>
: Replace tokens you have earned yourself<USERNAME>
: is your github username<REPO>
: Is the name of your warehouse
Don’t give up
Thanks for reading, I hope I can help you!
about
Author: Vam’s Golden Bean Road.
CSDN blog star of the Year 2019, CSDN blog has reached millions of visitors. Nuggets blog post repeatedly pushed to the home page, the total page view has reached hundreds of thousands.
In addition, my public number: front-end experience robbed road, the public continues to update the latest front-end technology and related technical articles. Welcome to pay attention to my public number, let us together in front of the road experience rob it! Go!