Search code examples
githubcommand-linepasswordstokentwo-factor-authentication

Are GitHub personal access tokens single use (then they expire/delete)?


Can GitHub personal access tokens be set to single use only?

I'm reading the GitHub Personal Access Token setup guide. It appears that I create a 'token' to eliminate the need for my 2FA code when using GitHub from the command line.

I want this token to either expire after I use it, or I want the ability to delete it permanently somehow after I use it. Is this possible? Otherwise it seems to defeat the purpose of 2FA because if somebody got my token they could get into my GitHub without 2FA.


Solution

  • There are two options to Delete a single token or Revoke All tokens in Github.