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
userpassmethod
Table of Contents
- Enable the userpass Auth Method
- Inspect Auth Backends
- Manage Policies
- Create and Configure Users
- Authenticate with userpass
1. Enable the userpass Auth Method
First, see which auth methods are currently enabled:
Enable
userpass at the default path:
userpass under a custom mount point, for example local:
If you only need the default mount, disable the custom one:
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:- default
- kv-policy
- root
kv-policy in this demo to grant Key/Value access.
4. Create and Configure Users
4.1 Create Users
Add a new user namedautomation with kv-policy:
userpass users:
Add a second user
bryan:
4.2 Read and Update User Configuration
Read Current Settings
Inspect theautomation user:
By default, TTLs are
0s, inheriting the system defaults.
Update Token TTL
Set a 24-hour token TTL forautomation:
:::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:kv-policy with a 24-hour TTL. To reuse the token directly:
Conclusion
You’ve successfully:- Enabled and inspected the
userpassauth method - Listed and managed Vault policies
- Created users and customized their token TTL
- Authenticated via
userpassfor secure, password-based access