|
1 | 1 | --- |
2 | | -title: Enable two-factor authentication for your Docker account |
| 2 | +title: Two-factor authentication for your individual Docker account |
3 | 3 | linkTitle: Two-factor authentication |
4 | 4 | description: >- |
5 | | - Enable or disable two-factor authentication on your Docker account for |
6 | | - enhanced security and account protection. |
7 | | -keywords: two-factor authentication, 2FA, docker hub security, |
8 | | - account security, TOTP, authenticator app, disable 2FA, recovery code |
| 5 | + Learn how two-factor authentication protects a Docker account, when Docker |
| 6 | + asks for the code, and what the recovery code does. |
| 7 | +keywords: two-factor authentication, 2FA, individual Docker account, TOTP, |
| 8 | + authenticator app, authentication code, recovery code, personal access |
| 9 | + token, docker login, Account settings, Docker Hub, account security |
9 | 10 | weight: 20 |
10 | 11 | aliases: |
11 | 12 | - /docker-hub/2fa/ |
12 | | - - /security/2fa/disable-2fa/ |
13 | 13 | - /security/for-developers/2fa/ |
14 | | - - /security/for-developers/2fa/disable-2fa/ |
15 | 14 | - /security/2fa/ |
| 15 | +grid: |
| 16 | + - title: Turn 2FA on or off |
| 17 | + description: >- |
| 18 | + Set up an authenticator app, save the recovery code, or turn 2FA off. |
| 19 | + icon: device-phone-mobile |
| 20 | + link: /security/authentication/2fa/manage/ |
| 21 | + - title: Recover your account |
| 22 | + description: >- |
| 23 | + Sign in with a recovery code, generate a new one, or contact Support. |
| 24 | + icon: key |
| 25 | + link: /security/authentication/2fa/recover-hub-account/ |
16 | 26 | --- |
17 | 27 |
|
18 | 28 | {{< summary-bar feature_name="2FA" >}} |
19 | 29 |
|
20 | | -Two-factor authentication (2FA) adds a security layer to your Docker account by |
21 | | -requiring a unique security code in addition to your password when signing in. |
22 | | -This prevents unauthorized access even if your password is compromised. |
| 30 | +Two-factor authentication (2FA) adds a code from an authenticator app to |
| 31 | +your password when you sign in to your Docker account. Someone who knows |
| 32 | +your password still needs the code from your device to sign in. |
23 | 33 |
|
24 | | -When you turn on two-factor authentication, Docker provides a unique recovery |
25 | | -code specific to your account. Store this code securely as it lets you recover |
26 | | -your account if you lose access to your authenticator app. |
27 | | - |
28 | | -## Key benefits |
29 | | - |
30 | | -Two-factor authentication improves your account security: |
31 | | - |
32 | | -- Protection against password breaches: Even if your password is stolen or |
33 | | - leaked, attackers can't access your account without your second factor. |
34 | | -- Secure CLI access: Required for Docker CLI authentication when 2FA is turned |
35 | | - on, ensuring automated tools use personal access tokens instead of passwords. |
36 | | -- Compliance requirements: Many organizations require 2FA for accessing |
37 | | - development and production resources. |
38 | | -- Peace of mind: Know that your Docker repositories, images, and account |
39 | | - settings are protected by industry-standard security practices. |
| 34 | +> [!TIP] |
| 35 | +> |
| 36 | +> Organization and company settings do not include 2FA. To control how |
| 37 | +> members sign in across an organization, use |
| 38 | +> [single sign-on](/manuals/security/authentication/single-sign-on/_index.md). |
40 | 39 |
|
41 | | -## Prerequisites |
| 40 | +## How two-factor authentication works |
42 | 41 |
|
43 | | -Before turning on two-factor authentication, you need: |
| 42 | +When you turn on 2FA, you pair a time-based one-time password (TOTP) |
| 43 | +authenticator app with your account by scanning a QR code or entering a |
| 44 | +text code. Any authenticator app that supports TOTP works. Docker keeps |
| 45 | +one authenticator per account. |
44 | 46 |
|
45 | | -- A smartphone or device with a time-based one-time password (TOTP) |
46 | | - authenticator app installed |
47 | | -- Access to your Docker account password |
| 47 | +After repeated wrong codes, Docker returns `Too many failed login |
| 48 | +attempts` and blocks further attempts for a short time. |
48 | 49 |
|
49 | | -## Enable two-factor authentication |
| 50 | +## When Docker asks for the code |
50 | 51 |
|
51 | | -To turn on 2FA for your Docker account: |
| 52 | +| Sign-in | What Docker asks for | |
| 53 | +| --- | --- | |
| 54 | +| Browser sign-in to Docker Home or Docker Hub | Your password, then the code from your authenticator app | |
| 55 | +| `docker login` with no username | The same browser sign-in, if the browser is not already signed in | |
| 56 | +| `docker login -u`, scripts, and CI | A [personal access token](/manuals/security/access-tokens/personal-access-tokens.md) in the password prompt. Password sign-in from the CLI is not supported when 2FA is on | |
52 | 57 |
|
53 | | -1. Sign in to your [Docker account](https://app.docker.com/login). |
54 | | -1. Select your avatar and then from the drop-down menu, select **Account |
55 | | - settings**. |
56 | | -1. Select **2FA**. |
57 | | -1. Enter your account password, then select **Confirm**. |
58 | | -1. Save your recovery code and store it somewhere safe. You can use your |
59 | | - recovery code to recover your account in the event you lose access to your |
60 | | - authenticator app. |
61 | | -1. Use a TOTP mobile app to scan the QR code or enter the text code. |
62 | | -1. Once you've linked your authenticator app, enter the six-digit code in the |
63 | | - text field. |
64 | | -1. Select **Enable 2FA**. |
| 58 | +## Recovery code |
65 | 59 |
|
66 | | -Two-factor authentication is now active on your account. You'll need to enter a |
67 | | -security code from your authenticator app each time you sign in. |
| 60 | +Docker gives you one recovery code when you turn on 2FA. The code signs |
| 61 | +you in if you lose your authenticator app, so copy, download, or print it |
| 62 | +and store it somewhere safe. |
68 | 63 |
|
69 | | -## Disable two-factor authentication |
| 64 | +Docker emails the verified address on your account when you turn 2FA on |
| 65 | +or off, when a recovery code is generated, and when a recovery code is |
| 66 | +used to sign in. The email does not contain the code. |
70 | 67 |
|
71 | | -> [!WARNING] |
72 | | -> |
73 | | -> Disabling two-factor authentication results in decreased security for your |
74 | | -> Docker account. |
| 68 | +## Next steps |
75 | 69 |
|
76 | | -1. Sign in to your [Docker account](https://app.docker.com/login). |
77 | | -1. Select your avatar and then from the drop-down menu, select **Account |
78 | | - settings**. |
79 | | -1. Select **2FA**. |
80 | | -1. Enter your password, then select **Confirm**. |
81 | | -1. Select **Disable 2FA**. |
| 70 | +{{< grid >}} |
0 commit comments