Skip to main content
In this tutorial, you’ll learn how to enable and manage the userpass auth method in Vault. We’ll cover:
  • Enabling and inspecting auth backends
  • Configuring and listing policies
  • Creating, reading, and updating users
  • Authenticating with the userpass method

Table of Contents

  1. Enable the userpass Auth Method
  2. Inspect Auth Backends
  3. Manage Policies
  4. Create and Configure Users
  5. Authenticate with userpass

1. Enable the userpass Auth Method

First, see which auth methods are currently enabled:
Example output: Enable userpass at the default path:
Success message:
:::note Custom Path You can also enable userpass under a custom mount point, for example local:
::: After enabling, verify both default and custom mounts:
If you only need the default mount, disable the custom one:
Now you should see:

2. Inspect Auth Backends

Vault supports multiple auth methods. To view all enabled backends:
For more details, see the Vault Authentication Methods reference.

3. Manage Policies

Before creating users, check existing policies:
Example output:
  • default
  • kv-policy
  • root
We’ll use kv-policy in this demo to grant Key/Value access.

4. Create and Configure Users

4.1 Create Users

Add a new user named automation with kv-policy:
Success message:
Verify the list of userpass users:
Add a second user bryan:
Confirm both users:

4.2 Read and Update User Configuration

Read Current Settings

Inspect the automation user:
By default, TTLs are 0s, inheriting the system defaults.

Update Token TTL

Set a 24-hour token TTL for automation:
Verify the update:
:::note Token Time-To-Live (TTL) Defining token_ttl limits how long a login token remains valid. Adjust according to your security requirements. :::

5. Authenticate with userpass

Now that your user is configured, log in with:
Enter the password when prompted. Example response:
You now have a token scoped to kv-policy with a 24-hour TTL. To reuse the token directly:
Success message:
:::warning Security Reminder Always store your Vault tokens securely. Avoid checking plaintext tokens into version control or logs. :::

Conclusion

You’ve successfully:
  • Enabled and inspected the userpass auth method
  • Listed and managed Vault policies
  • Created users and customized their token TTL
  • Authenticated via userpass for secure, password-based access
For more on Vault auth methods and best practices, visit the HashiCorp Vault Documentation.

Watch Video

Practice Lab