Updated content (#13084)

* updated content

* fixed typo

* fixed formatting

* fixed note images format

* Fixed attribute

* updated note

* added matrix

* updated formatting

* updated note

* formatting

* updated note

* removed sentence

* added API

* updated API info

* updated API info

* removed file

* Update docker-hub/access-tokens.md

Co-authored-by: Sebastiaan van Stijn <thaJeztah@users.noreply.github.com>

* Update docker-hub/access-tokens.md

Co-authored-by: Sebastiaan van Stijn <thaJeztah@users.noreply.github.com>

* Update docker-hub/access-tokens.md

Co-authored-by: Sebastiaan van Stijn <thaJeztah@users.noreply.github.com>

* Update docker-hub/access-tokens.md

Co-authored-by: Sebastiaan van Stijn <thaJeztah@users.noreply.github.com>

* Update docker-hub/access-tokens.md

Co-authored-by: Sebastiaan van Stijn <thaJeztah@users.noreply.github.com>

Co-authored-by: Sebastiaan van Stijn <thaJeztah@users.noreply.github.com>
This commit is contained in:
jerae-duffin 2021-07-20 12:26:13 -05:00 committed by GitHub
parent eb7163503b
commit 7f3af332cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 55 additions and 32 deletions

View File

@ -7,62 +7,85 @@ keywords: docker hub, hub, security, PAT, personal access token
Docker Hub lets you create personal access tokens as alternatives to your password. You can use tokens to access Hub images from the Docker CLI.
Using personal access tokens provides some advantages over a password:
* You can investigate when an access token was used last, and disable or delete it if you find any suspicious activity.
* You can investigate the last usage of the access token and disable or delete it if you find any suspicious activity.
* When logged in with an access token, you can't perform any admin activity on the account, including changing the password.
Access tokens are also useful in building integrations, since you can issue
>**Important**
>
> Treat access tokens like your password and keep them secret. Store your
> tokens securely (for example, in a credential manager).
{: .important}
Access tokens are valuable for building integrations, as you can issue
multiple tokens &ndash; one for each integration &ndash; and revoke them at
any time.
> Note: If you have [two-factor authentication (2FA)](/docker-hub/2fa) enabled on your account, you must create at least one personal access token. Otherwise, you will be unable to log in to your account from the Docker CLI.
{: .important }
>**Note**
>
> If you have [two-factor authentication (2FA)](2fa/index.md) enabled on
> your account, you must create at least one personal access token. Otherwise,
> you will be unable to log in to your account from the Docker CLI.
## Create an access token
You can create as many tokens as you need.
1. Log in to [hub.docker.com](https://hub.docker.com).
1. Log in to [hub.docker.com](https://hub.docker.com){: target="_blank" rel="noopener" class="_"}.
2. Click on your username in the top right corner and select **Account
Settings**.
2. Click on your username in the top right corner and select **[Account Settings](https://hub.docker.com/settings/general)**.
3. Select **Security > New Access Token**.
![](images/hub-create-token.png)
3. Select **[Security](https://hub.docker.com/settings/security) > New Access Token**.
4. Add a description for your token. Use something that indicates where
the token is going to be used, or set a purpose for the token.
the token will be used, or set a purpose for the token.
5. Copy the token that appears on the screen. Make sure you do this now:
once you close this prompt, Docker will never show the token again.
![PAT Menu](images/hub-create-token.png){:width="700px"}
![](images/hub-copy-token.png)
5. You can view the following permissions from the drop-down:
Treat access tokens like your password and keep them secret. Store your tokens securely (for example, in a credential manager).
| Features | Free | Pro | Team |
| --------------------- | ---- | ----- | ----- |
| Personal Access Tokens (read, write, delete scope only)* | x | x | x |
| Scoped Personal Access Tokens | | x | x |
| Unlimited Personal Access Tokens | | | x |
>*You can create 1 access token as part of the Free plan, 5 tokens per the Pro plan, and Unlimited tokens for the Team plan.
For more information about a Pro or a Team plan, see [Docker Pricing](https://www.docker.com/pricing?utm_source=docker&utm_medium=webreferral&utm_campaign=docs_driven_upgrade){: target="_blank" rel="noopener" class="_"}.
## Modify existing tokens
You can rename, deactivate, or delete a token as needed.
1. Access your tokens under **Account Settings > Security**.
2. Select a token and click **Delete** or **Edit**, or use the menu on
the far right of a token row to bring up the edit screen. You can also
select multiple tokens to delete them all once.
![](images/hub-edit-token.png)
6. Copy the token that appears on the screen and save it. You will not be able to retrieve the token once you close this prompt.
![Copy Token](images/hub-copy-token.png){:width="700px"}
## Use an access token
You can use an access token anywhere that requires your Docker Hub
password.
When logging in from your Docker CLI client (`docker login --username <username>`),
omit the password in the login command. When you're prompted for
a password, enter your token instead.
When logging in from your Docker CLI client (`docker login --username <username>`), omit the password in the login command. Instead, enter your token when asked for a password.
If you have 2FA enabled, you must use a personal access token when logging in
from the Docker CLI. If you don't have it enabled, this is an optional (but
more secure) method of authentication.
> **Note**
>
> If you have [two-factor authentication (2FA)](2fa/index.md) enabled, you must
> use a personal access token when logging in from the Docker CLI. 2FA is an
> optional, but more secure method of authentication.
## Modify existing tokens
You can rename, activate, deactivate, or delete a token as needed.
1. Access your tokens under **[Account Settings > Security](https://hub.docker.com/settings/security){: target="_blank" rel="noopener" class="_"}**.
2. Select a token and click **Delete** or **Edit**, or use the menu on
the far right of a token row to bring up the edit screen. You can also
select multiple tokens to delete at once.
![Delete or Edit](images/hub-delete-edit-token.png){:width="700px"}
> **Note**
>
> You can also view the number of tokens that are activated and deactivated in the toolbar.
![Modify Token](images/hub-edit-token.png){:width="700px"}
Docker provides a [Docker Hub CLI](https://github.com/docker/hub-tool#readme){: target="_blank" rel="noopener" class="_"} tool (currently experimental) and an API that allows you to interact with Docker Hub. Browse through the [Docker Hub API](/docker-hub/api/latest/){: target="_blank" rel="noopener" class="_"} documentation to explore the supported endpoints.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 244 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 64 KiB