Skip to main content
In this tutorial, you’ll learn how to enable and use the userpass authentication method in HashiCorp Vault. This approach is ideal for simple username/password scenarios.

Prerequisites

  • Vault CLI installed and configured
  • Vault server unsealed and reachable
  • A Vault token with root or sudo privileges
For more details on installing Vault, see the Vault Installation Guide.

1. Verify Existing Auth Methods

Before enabling new methods, check which authentication backends are active:
Example output:
The token method is enabled by default and provides basic token authentication.

2. Enable the Userpass Auth Method

Activate the userpass backend at its default path:
Expected response:

3. Create Userpass Users

Add individual users under auth/userpass/users. Each user can be assigned one or more policies.

3.1 Create User “frank”

3.2 Create User “jamie”

Storing plaintext passwords in scripts can be insecure. Consider using environment variables or a secure secrets store.

4. List and Inspect User Configurations

4.1 List All Users

Example output:

4.2 Read a User’s Settings

Inspect configuration for user jamie:
Key settings include token TTLs, policies, and CIDR restrictions.

5. Authenticate with Userpass

After creating users, log in using the userpass method. Each login issues a distinct Vault token.

5.1 Login as “jamie”

Enter password when prompted:

5.2 Login as “frank”

Enter password:
Each session returns token details:

References

Watch Video

Practice Lab