17

Today GitHub surprise me with a new way to push, clone, or pull a repo

when I'm trying to push my project I get this error message:

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.
fatal: unable to access 'https://github.com/barimehdi77/Philosophers.git/': The requested URL returned error: 403

after multiple searches I fined that GitHub adds a new security update named Personal access tokens but who can I use it?

DarkSide77
  • 719
  • 1
  • 4
  • 21

2 Answers2

19

You have to use SSH keys. Create one for each computer and register them all to the repo that you need to access. Doing this allows you to remove access computer by computer.

Once you have the SSH keys configured in Github, you can read this article to setup the Personal Access Tokens.

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

UPDATE It tells you how to change to the token in the documentation

Using a token on the command line

Once you have a token, you can enter it instead of your password when performing Git operations over HTTPS.

For example, on the command line you would enter the following:

$ git clone https://github.com/username/repo.git <--- HTTPS, not SSH
Username: your_username
Password: your_token <-------- THE TOKEN, not your password

Personal access tokens can only be used for HTTPS Git operations. If your repository uses an SSH remote URL, you will need to switch the remote from SSH to HTTPS.

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.

Instead of manually entering your PAT for every HTTPS Git operation, you can cache your PAT with a Git client. Git will temporarily store your credentials in memory until an expiry interval has passed. You can also store the token in a plain text file that Git can read before every request. For more information, see "Caching your GitHub credentials in Git."

Also found a good video walkthrough that may help clear up a few things.

https://www.youtube.com/watch?v=kHkQnuYzwoo

Adrian J. Moreno
  • 14,350
  • 1
  • 37
  • 44
  • I read the article but I don't know how to reset my password with the token so that's why I asked this question in first place – DarkSide77 Jul 01 '21 at 13:04
0

The previous password will not work. you have to use a token as a password.

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

You can create your token following these steps:

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