DEV Community

loading...

Token authentication for Git

nashmeyah profile image Nashmeyah ・2 min read

In July, GitHub announced the intent to using token-based authentication for all authenticated Git operations. Beginning August 13, 2021, account passwords authenticating Git operations will no longer be accepted. The workflows affected:

  1. Command line Git access
  2. Desktop applications using Git
  3. Any apps/services that access Git repositories on GitHub.com directly using your password

If you are still using passwords, we suggest you switch to personal access tokens or SSH keys. If you want to create a personal token, here is a document from GitHub to do exactly that: https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token .

if you want to create and SSH key (personal preference because it saves so much headache, but it has slightly few more steps to accomplish this goal), here is the document to do exactly that: https://docs.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent, follow all these steps and read thoroughly because there are 3 steps you need to accomplish in order to successfully get this to work.

  1. Check if you have an SSH key, if not create a new one.
  2. Add the key to the SSH agent.
  3. Add the Key to your GitHub.

Personally and preferably, setting the SSH key will save you headache, heartache, stomachache, younameitache later. SSH key allows you to push to your GitHub without having to constantly enter your name and password from you command line.

"Using the SSH protocol, you can connect and authenticate to remote servers and services. With SSH keys, you can connect to GitHub without supplying your username and personal access token at each visit."(2021 GitHub, Inc, online documents).

If you would like an extra layer of security for GitHub after you have set the SSH key. Here is a document from GitHub explaining and a step by step guide to creating SSH key passphrases.

"You can secure your SSH keys and configure an authentication agent so that you won't have to reenter your passphrase every time you use your SSH keys." :https://docs.github.com/en/github/authenticating-to-github/working-with-ssh-key-passphrases

Thank you! I hope you found this helpful, I recently found out about this and thought I should share it to save others from trouble as well.

Discussion (0)

pic
Editor guide