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:| Path | Type | Accessor | Description |
|---|---|---|---|
| token/ | token | auth_token_9e81d3bb | token based credentials |
userpass at the default path:
userpass under a custom mount point, for example local:
| Path | Type | Accessor | Description |
|---|---|---|---|
| local/ | userpass | auth_userpass_abcd123 | n/a |
| userpass/ | userpass | auth_userpass_efgh456 | n/a |
| token/ | token | auth_token_9e81d3bb | token based credentials |
| Path | Type | Accessor | Description |
|---|---|---|---|
| token/ | token | auth_token_9e81d3bb | token based credentials |
| userpass/ | userpass | auth_userpass_efgh456 | n/a |
2. Inspect Auth Backends
Vault supports multiple auth methods. To view all enabled backends:| Mount Point | Auth Method | Description |
|---|---|---|
| token/ | token | Token-based authentication |
| userpass/ | userpass | Username & password |
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:
| Keys |
|---|
| automation |
bryan:
| Keys |
|---|
| automation |
| bryan |
4.2 Read and Update User Configuration
Read Current Settings
Inspect theautomation user:
| Key | Value |
|---|---|
| policies | [kv-policy] |
| token_ttl | 0s |
| token_max_ttl | 0s |
| token_no_default_policy | false |
0s, inheriting the system defaults.
Update Token TTL
Set a 24-hour token TTL forautomation:
| Key | Value |
|---|---|
| token_ttl | 24h |
| policies | [kv-policy] |
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