You can reconfigure your two-factor authentication (2FA) settings or add new 2FA methods without disabling 2FA entirely, allowing you to keep both your recovery codes and your membership in organizations that require 2FA.
Changing an existing two-factor authentication method
You can change the time-based one-time password (TOTP) application you use to generate authentication codes.
-
In the upper-right corner of any page on GitHub, click your profile photo, then click Settings.
-
In the "Access" section of the sidebar, click Password and authentication.
-
In "Two-factor methods", find the method you want to modify. Next to that method, click Edit. If you have multiple methods configured, select , then click Edit.
-
Under "Scan the QR code", do one of the following:
- Scan the QR code with your mobile device's app. After scanning, the app displays a six-digit code that you can enter on GitHub Enterprise Server.
- If you can't scan the QR code, click setup key to see a code, the TOTP secret, that you can manually enter in your TOTP app instead.
-
The TOTP application saves your account on your GitHub Enterprise Server instance and generates a new authentication code every few seconds. On GitHub Enterprise Server, type the code into the field under "Verify the code from the app."
-
Click Save to save the method to your GitHub account.
Warning
Changes to an existing 2FA method will only take effect after you have provided a valid code from the new method and clicked Save. Only replace the existing 2FA method on your device (e.g. the GitHub entry in your TOTP app) after your new method is saved to your GitHub account completely.
If you are unable to scan the setup QR code or wish to setup a TOTP app manually and require the parameters encoded in the QR code, they are:
- Type:
TOTP
- Label:
GitHub:<username>
where<username>
is your handle on GitHub, for examplemonalisa
- Secret: This is the encoded setup key, shown if you click "Setup key" during configuration
- Issuer:
GitHub
- Algorithm: The default of SHA1 is used
- Digits: The default of 6 is used
- Period: The default of 30 (seconds) is used
Adding additional two-factor authentication methods
We recommend adding more than one 2FA method to your account. This ensures that you can still sign in to your account, even if you lose one of your methods.
In addition to adding multiple 2FA methods, we strongly recommend setting up multiple recovery methods to avoid losing access to your account. For more information, see Configuring two-factor authentication recovery methods.
-
In the upper-right corner of any page on GitHub, click your profile photo, then click Settings.
-
In the "Access" section of the sidebar, click Password and authentication.
-
In "Two-factor methods", find the method you want to add. Next to that method, click Add.
-
Under "Scan the QR code", do one of the following:
- Scan the QR code with your mobile device's app. After scanning, the app displays a six-digit code that you can enter on GitHub Enterprise Server.
- If you can't scan the QR code, click setup key to see a code, the TOTP secret, that you can manually enter in your TOTP app instead.
-
The TOTP application saves your account on your GitHub Enterprise Server instance and generates a new authentication code every few seconds. On GitHub Enterprise Server, type the code into the field under "Verify the code from the app."
-
Click Save to save the method to your GitHub account. If you are unable to scan the setup QR code or wish to setup a TOTP app manually and require the parameters encoded in the QR code, they are:
- Type:
TOTP
- Label:
GitHub:<username>
where<username>
is your handle on GitHub, for examplemonalisa
- Secret: This is the encoded setup key, shown if you click "Setup key" during configuration
- Issuer:
GitHub
- Algorithm: The default of SHA1 is used
- Digits: The default of 6 is used
- Period: The default of 30 (seconds) is used
Setting a preferred two-factor authentication method
If you have multiple 2FA methods, you can choose a preferred method that will be shown first when you are asked to authenticate with 2FA.
- In the upper-right corner of any page on GitHub, click your profile photo, then click Settings.
- In the "Access" section of the sidebar, click Password and authentication.
- Under "Two-factor authentication" in "Preferred 2FA method", select your preferred 2FA method from the dropdown.