<commit_before>---
type: howto
---

# Two-Factor Authentication

Two-factor Authentication (2FA) provides an additional level of security to your
GitLab account. Once enabled, in addition to supplying your username and
password to login, you'll be prompted for a code generated by your one time password
authenticator. For example, a password manager on one of your devices.

By enabling 2FA, the only way someone other than you can log into your account
is to know your username and password *and* have access to your one time password secret.

## Overview

TIP: **Tip:**
When you enable 2FA, don't forget to back up your [recovery codes](#recovery-codes)!

In addition to time-based one time passwords (TOTP), GitLab supports U2F
(universal 2nd factor) devices as the second factor of authentication. Once
enabled, in addition to supplying your username and password to log in, you'll
be prompted to activate your U2F device (usually by pressing a button on it),
and it will perform secure authentication on your behalf.

It is highly recommended that you set up 2FA with both a
[one-time password authenticator](#enable-2fa-via-one-time-password-authenticator)
and a [U2F device](#enable-2fa-via-u2f-device), so you can still access your account
if you lose your U2F device.

## Enabling 2FA

There are two ways to enable two-factor authentication: via a one time password authenticator
or a U2F device.

### Enable 2FA via one time password authenticator

To enable 2FA:

1. **In GitLab:**
   1. Log in to your GitLab account.
   1. Go to your **Profile Settings**.
   1. Go to **Account**.
   1. Click **Enable Two-factor Authentication**.
1. **On your device (usually your phone):**
   1. Install a compatible application, like:
      - [Authenticator](https://mattrubin.me/authenticator/): open source app for iOS devices.
      - [andOTP](https://github.com/andOTP/andOTP): feature rich open source app for Android which supports PGP encrypted backups.
      - [FreeOTP](https://freeotp.github.io/): open source app for Android.
      - [Google Authenticator](https://support.google.com/accounts/answer/1066447?hl=en): proprietary app for iOS and Android.
   1. In the application, add a new entry in one of two ways:
      - Scan the code presented in GitLab with your device's camera to add the
        entry automatically.
      - Enter the details provided to add the entry manually.
1. **In GitLab:**
   1. Enter the six-digit pin number from the entry on your device into the **Pin
      code** field.
   1. Click **Submit**.

If the pin you entered was correct, you'll see a message indicating that
Two-Factor Authentication has been enabled, and you'll be presented with a list
of [recovery codes](#recovery-codes). Make sure you download them and keep them
in a safe place.<commit_msg>Docs: Add Sailfish app to 2fa<commit_after>---
type: howto
---

# Two-Factor Authentication

Two-factor Authentication (2FA) provides an additional level of security to your
GitLab account. Once enabled, in addition to supplying your username and
password to login, you'll be prompted for a code generated by your one time password
authenticator. For example, a password manager on one of your devices.

By enabling 2FA, the only way someone other than you can log into your account
is to know your username and password *and* have access to your one time password secret.

## Overview

TIP: **Tip:**
When you enable 2FA, don't forget to back up your [recovery codes](#recovery-codes)!

In addition to time-based one time passwords (TOTP), GitLab supports U2F
(universal 2nd factor) devices as the second factor of authentication. Once
enabled, in addition to supplying your username and password to log in, you'll
be prompted to activate your U2F device (usually by pressing a button on it),
and it will perform secure authentication on your behalf.

It is highly recommended that you set up 2FA with both a
[one-time password authenticator](#enable-2fa-via-one-time-password-authenticator)
and a [U2F device](#enable-2fa-via-u2f-device), so you can still access your account
if you lose your U2F device.

## Enabling 2FA

There are two ways to enable two-factor authentication: via a one time password authenticator
or a U2F device.

### Enable 2FA via one time password authenticator

To enable 2FA:

1. **In GitLab:**
   1. Log in to your GitLab account.
   1. Go to your **Profile Settings**.
   1. Go to **Account**.
   1. Click **Enable Two-factor Authentication**.
1. **On your device (usually your phone):**
   1. Install a compatible application, like:
      - [Authenticator](https://mattrubin.me/authenticator/): open source app for iOS devices.
      - [andOTP](https://github.com/andOTP/andOTP): feature rich open source app for Android which supports PGP encrypted backups.
      - [FreeOTP](https://freeotp.github.io/): open source app for Android.
      - [Google Authenticator](https://support.google.com/accounts/answer/1066447?hl=en): proprietary app for iOS and Android.
      - [SailOTP](https://openrepos.net/content/seiichiro0185/sailotp): open source app for SailFish OS.
   1. In the application, add a new entry in one of two ways:
      - Scan the code presented in GitLab with your device's camera to add the
        entry automatically.
      - Enter the details provided to add the entry manually.
1. **In GitLab:**
   1. Enter the six-digit pin number from the entry on your device into the **Pin
      code** field.
   1. Click **Submit**.

If the pin you entered was correct, you'll see a message indicating that
Two-Factor Authentication has been enabled, and you'll be presented with a list
of [recovery codes](#recovery-codes). Make sure you download them and keep them
in a safe place.
{'fraction_non_alphanumeric': 0.08052401746724891, 'fraction_numerical': 0.012751091703056768, 'mean_word_length': 3.860780984719864, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 9, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5155553', 'n_tokens_mistral': 1640, 'n_tokens_neox': 1542, 'n_words': 793}