Skip to content

Commit 4d3cbcd

Browse files
docs: refresh the two-factor authentication pages (#26234)
The 2FA section page mixed concepts with enable and disable steps, and the same recovery-code and sign-in details appeared on more than one page. This splits procedures onto a manage page, keeps the overview to how 2FA works and when Docker asks for the code, and leaves the recover page for the recovery-code and Support steps. --------- Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 1cbac58 commit 4d3cbcd

6 files changed

Lines changed: 185 additions & 84 deletions

File tree

‎content/manuals/accounts/individual/_index.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ grid:
2323
link: /security/access-tokens/
2424
- title: Set up two-factor authentication
2525
description: Add an extra layer of authentication to your Docker account.
26-
link: /security/2fa/
26+
link: /security/authentication/2fa/manage/
2727
icon: device-phone-mobile
2828
- title: Organization accounts
2929
description: Learn how to create and manage Docker organizations.

‎content/manuals/accounts/individual/create-account.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,4 @@ basis:
8787
## Next steps
8888

8989
- [Manage a Docker account](/manuals/accounts/individual/manage-account.md)
90-
- [Enable two-factor authentication](/manuals/security/authentication/2fa/_index.md)
90+
- [Enable two-factor authentication](/manuals/security/authentication/2fa/manage.md)

‎content/manuals/accounts/individual/manage-account.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ To update your two-factor authentication (2FA) settings:
7979
1. Select **2FA**.
8080

8181
For more information, see
82-
[Enable two-factor authentication](/manuals/security/authentication/2fa/_index.md).
82+
[Enable two-factor authentication](/manuals/security/authentication/2fa/manage.md).
8383

8484
## Manage personal access tokens
8585

@@ -129,4 +129,4 @@ For information on deactivating your account, see
129129

130130
- [Docker individual accounts overview](/manuals/accounts/individual/_index.md)
131131
- [Create a Docker account](/manuals/accounts/individual/create-account.md)
132-
- [Enable two-factor authentication](/manuals/security/authentication/2fa/_index.md)
132+
- [Enable two-factor authentication](/manuals/security/authentication/2fa/manage.md)
Lines changed: 47 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,70 @@
11
---
2-
title: Enable two-factor authentication for your Docker account
2+
title: Two-factor authentication for your individual Docker account
33
linkTitle: Two-factor authentication
44
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
910
weight: 20
1011
aliases:
1112
- /docker-hub/2fa/
12-
- /security/2fa/disable-2fa/
1313
- /security/for-developers/2fa/
14-
- /security/for-developers/2fa/disable-2fa/
1514
- /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/
1626
---
1727

1828
{{< summary-bar feature_name="2FA" >}}
1929

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.
2333

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).
4039
41-
## Prerequisites
40+
## How two-factor authentication works
4241

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.
4446

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.
4849

49-
## Enable two-factor authentication
50+
## When Docker asks for the code
5051

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 |
5257

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
6559

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.
6863

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.
7067

71-
> [!WARNING]
72-
>
73-
> Disabling two-factor authentication results in decreased security for your
74-
> Docker account.
68+
## Next steps
7569

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 >}}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
title: Manage two-factor authentication for your Docker account
3+
linkTitle: Manage
4+
description: >-
5+
Turn on two-factor authentication for your Docker account, save the
6+
recovery code, move 2FA to a new device, or turn 2FA off.
7+
keywords: enable 2FA, disable 2FA, turn on 2FA, turn off 2FA, two-factor
8+
authentication, Docker account, TOTP, authenticator app, QR code,
9+
recovery code, new device, personal access token, Docker Hub
10+
weight: 10
11+
aliases:
12+
- /security/2fa/disable-2fa/
13+
- /security/for-developers/2fa/disable-2fa/
14+
---
15+
16+
{{< summary-bar feature_name="2FA" >}}
17+
18+
Turn two-factor authentication (2FA) on or off for your Docker account
19+
in **Account settings**. For how 2FA works, when Docker asks for the
20+
code, and what the recovery code does, see
21+
[Two-factor authentication][overview].
22+
23+
## Prerequisites
24+
25+
Before you turn on 2FA, you need:
26+
27+
- A time-based one-time password (TOTP) authenticator app on your phone or
28+
another device
29+
- Your Docker account password
30+
- A verified email address on your account
31+
32+
## Enable two-factor authentication
33+
34+
To turn on 2FA for your Docker account:
35+
36+
1. Sign in to your [Docker account](https://app.docker.com/login).
37+
1. Select your avatar in the top-right corner, then select **Account
38+
settings**.
39+
1. Select **2FA**.
40+
1. Enter your account password, then select **Confirm**.
41+
1. Save your recovery code. Select **Copy**, or open the menu next to
42+
**Copy** and select **Download** or **Print**.
43+
1. Open your authenticator app. Scan the code on the **QR Code** tab, or
44+
enter the code from the **Text Code** tab.
45+
1. Enter the six-digit code from your authenticator app in
46+
**Authentication code**.
47+
1. Select **Enable 2FA**.
48+
49+
Two-factor authentication is on. When you sign in with your password,
50+
Docker asks for a code from your authenticator app. Docker also emails
51+
you a reminder to save your recovery code.
52+
53+
## Disable two-factor authentication
54+
55+
> [!WARNING]
56+
>
57+
> Turning off 2FA leaves your account protected by your password alone.
58+
59+
1. Sign in to your [Docker account](https://app.docker.com/login).
60+
1. Select your avatar in the top-right corner, then select **Account
61+
settings**.
62+
1. Select **2FA**.
63+
1. Enter your password, then select **Confirm**.
64+
1. Select **Disable 2FA**.
65+
66+
Two-factor authentication is off. Docker emails you to confirm the
67+
change.
68+
69+
## Move 2FA to a new device
70+
71+
To move 2FA to a new phone or device,
72+
[turn 2FA off](#disable-two-factor-authentication), then
73+
[turn it on again](#enable-two-factor-authentication) from the new
74+
device.
75+
76+
## Next steps
77+
78+
- [Recover your account][recover] if you lose your authenticator app or
79+
recovery code.
80+
- Create a [personal access token][pat] to sign in from the Docker CLI,
81+
scripts, and CI.
82+
83+
[overview]: /manuals/security/authentication/2fa/_index.md
84+
[pat]: /manuals/security/access-tokens/personal-access-tokens.md
85+
[recover]: /manuals/security/authentication/2fa/recover-hub-account.md
Lines changed: 49 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
---
2-
title: Recover your Docker account
2+
title: Recover your Docker account and two-factor recovery code
33
linkTitle: Recover your account
44
description: >-
5-
Recover your Docker account and manage two-factor authentication recovery
6-
codes.
5+
Sign in with a recovery code, generate a new recovery code, or contact
6+
Support when you lose your authenticator app.
77
keywords: account recovery, two-factor authentication, 2FA, recovery code,
8-
docker hub security, lost authenticator app, 2FA lockout
8+
Lost Authentication Device, lost authenticator app, 2FA lockout, Docker
9+
account, Generate new code, Docker Support
910
aliases:
1011
- /docker-hub/2fa/recover-hub-account/
1112
- /security/for-developers/2fa/recover-hub-account/
@@ -16,32 +17,58 @@ weight: 20
1617

1718
{{< summary-bar feature_name="2FA" >}}
1819

19-
If you lose your two-factor authentication recovery code, or lose access to both
20-
your authenticator app and your recovery code, you can generate a new code or
21-
contact Support to recover your account.
20+
Get back into your Docker account when you lose your authenticator app,
21+
your recovery code, or both. Docker asks for your password before it
22+
shows or replaces the recovery code.
23+
24+
> [!IMPORTANT]
25+
>
26+
> The recovery code works once. Using it on the **Lost Authentication
27+
> Device** page signs you in, turns 2FA off, and deletes the code. Turn
28+
> 2FA on again from your new device as soon as you're signed in.
2229
2330
## Generate a new recovery code
2431

25-
If you lost your two-factor authentication recovery code but still have access
26-
to your Docker Hub account, you can generate a new recovery code.
32+
If you lost your recovery code and can still sign in, generate a new one.
33+
The new code replaces the previous code.
2734

28-
1. Sign in to your [Docker account](https://app.docker.com/login) with your
29-
username and password.
30-
1. Select your avatar and from the drop-down menu, select **Account settings**.
35+
1. Sign in to your [Docker account](https://app.docker.com/login). Enter
36+
your password, then the code from your authenticator app.
37+
1. Select your avatar in the top-right corner, then select **Account
38+
settings**.
3139
1. Select **2FA**.
3240
1. Enter your password, then select **Confirm**.
3341
1. Select **Generate new code**.
3442

35-
This generates a new code. Select the visibility icon to view the code. Save
36-
your recovery code and store it somewhere safe.
43+
Select the visibility icon to view the new code. Then select **Copy**,
44+
**Download**, or **Print**, and store the code somewhere safe.
45+
46+
## Sign in with your recovery code
47+
48+
If you lost your authenticator app and still have your recovery code, use
49+
the code to sign in.
50+
51+
1. Sign in to your [Docker account](https://app.docker.com/login) with your
52+
username and password.
53+
1. On the **Two-Factor Authentication** page, select **I've lost my
54+
authentication device**.
55+
1. Enter your recovery code, then select **Verify**.
56+
57+
You're signed in and 2FA is off. To protect your account again, follow
58+
[Turn on 2FA][enable].
59+
60+
## Contact Docker Support
61+
62+
If you lost both your authenticator app and your recovery code, open the
63+
[Contact Support form](https://hub.docker.com/support/contact/?category=2fa-lockout).
64+
The subject and description already describe a 2FA lockout. Enter the
65+
email address on your Docker account, then follow the instructions from
66+
Docker Support.
3767

38-
## Recover your account without access
68+
## Next steps
3969

40-
If you lost access to both your two-factor authentication application and your
41-
recovery code, you can't complete the normal sign-in process because you don't
42-
have the required 2FA verification code.
70+
- [Turn on 2FA][enable] again after you recover your account.
71+
- Create a [personal access token][pat] for the Docker CLI and automation.
4372

44-
Complete the
45-
[Contact Support form](https://hub.docker.com/support/contact/?category=2fa-lockout)
46-
with the primary email address associated with your Docker ID and follow the
47-
recovery instructions provided by Docker Support.
73+
[enable]: /manuals/security/authentication/2fa/manage.md
74+
[pat]: /manuals/security/access-tokens/personal-access-tokens.md

0 commit comments

Comments
 (0)