githubtwo-factor-authentication

How to get two factor authentication when resetting password and no devices configured for two factor


I recently wanted to use one of my old project specific GitHub account, where the two factor authentication was enabled. Since I was not able to remember the password I used the option Forgot password and reset the password.

However after successfully changing the credentials, GitHub is as usual expecting the two way authentication key, since I was not having the same device now, I don't have the GitHub configured to get the Two way authentication, neither I have any more information about the account, rather than my login credentials.

Is there any way I could get the two - way refactor working. Or I could login?


Solution

  • If have the credential of the GitHub account, you can login to said account, and enable 2FA

    https://help.github.com/assets/images/help/2fa/2fa-settings.png

    Then you can generate a PAT (Personal Access Token) in order to use that as a password (and bypass the 2fa step when pushing in command-line).

    Personal access tokens are useful when it's too cumbersome to provide a client/secret pair for a full application, such as when authenticating to GitHub from Git using HTTPS, or within a command line utility or script.


    Later I reset my password , and I was't having the device which i had configured my DuO Mobile. How could I login now. It is asking for 2FA and I don't have any way to provide the key.

    Then you would need to follow "Recovering your account if you lost your 2FA credentials"

    Having access to your recovery codes in a secure place, or establishing a secondary mobile phone number for recovery, will get you back into your account.