Skip to main content
Vault tokens are the primary authentication mechanism for interacting with HashiCorp Vault. Using the Vault CLI, you can create, inspect, renew, revoke, and check capabilities of tokens to tailor access control for your applications and users.

Table of Contents

  1. Creating a Token
  2. Looking Up a Token
  3. Renewing a Token
  4. Revoking a Token
  5. Checking Token Capabilities
  6. References

1. Creating a Token

Use the vault token create command to generate a new token with a specified TTL (time-to-live) and attached policies.
Example output:
You can further customize a token with -display_name, multiple policies, and an explicit maximum TTL.
  • -display_name: Human-friendly identifier
  • -policy: Comma-separated Vault policies
  • -ttl: Initial lifetime (e.g., 24h)
  • -explicit-max-ttl: Maximum lifetime across renewals

2. Looking Up a Token

Inspect metadata for any token by running:
Example:
If you omit the identifier, Vault returns details for the token in your $VAULT_TOKEN:

3. Renewing a Token

Extend a token’s TTL using vault token renew. You can renew by token ID or accessor:
Renewal output confirms the new TTL and policies:

4. Revoking a Token

To immediately invalidate a token, use:
Example:
Revoking a token is irreversible. Any sessions or processes using that token will lose access immediately.

5. Checking Token Capabilities

Determine which operations a token can perform on a specific path:
Example:
Output:
This helps you audit and verify permissions for service accounts or automation tools.

6. References

Watch Video