Setting up two-factor authentication
While it is important to have a strong password for extra security, it is a good idea to configure two-factor authentication for your account in case your password or device ever gets compromised.
With two-factor authentication, you will be asked for an authentication code generated using your phone in addition to your password when logging into Codeberg.
That way, your account cannot be compromised even if your password gets compromised, as long as your phone stays safe.
You will need an authenticator app installed on your phone.
After scanning the QR code with your app, enter the six-digit code displayed in your app into the "Passcode" field of the settings form, then click "Verify".
If your phone ever breaks, gets lost or gets stolen, you can recover your account using the scratch token.
This is shown to you right after setting up 2FA:
Please store this token in a safe place.
That's it - you have now configured two-factor authentication for your account.
From now on, each time you log into Codeberg you will be asked for an authentication code from your app, adding an extra layer of security over just using a password.
If you push to Codeberg via HTTP (see Clone & Commit via HTTP), an extra step will be needed to create a personal access token. This token will replace your normal password (+ authentication code) on Codeberg.
In your profile settings on Codeberg, go to the
In the section
Manage Access Tokens, add a
Token Name and confirm by clicking on
Make sure you keep the generated token in a safe place, because it will not be shown again.
When asked for your password, just enter the token.
You can create as many tokens as you'd like: one for each computer, one for each Git client, one for each session... you decide! You can also revoke tokens at any time by pressing
Delete next to the token (see previous screenshot).
Hey there! 👋 Thank you for reading this article!
Is there something missing, or do you have an idea on how to improve the documentation? Do you want to write your own article?
For an introduction on contributing to Codeberg Documentation, please have a look at the Contributor FAQ.
© Codeberg Docs Contributors. See LICENSE