Bootstrap FreeKB - Hashicorp Vault - Login to the vault using the vault login command
Hashicorp Vault - Login to the vault using the vault login command

Updated:   |  Hashicorp Vault articles

This assumes the following has already been done.

When starting the vault, the initial root token will be displayed, like this.

Initial Root Token: s.gYGVHcHMiGsCZdKAJzWq1Yj1

 

The vault login command can be used to log into the vault. The token can be used to log into the vault.

vault login s.gYGVHcHMiGsCZdKAJzWq1Yj1

 

If you installed the vault CLI on a system different from the system that Hashicorp Vault was installed on, include the -address option where address will be something like http://vault.example.com:8200.

vault login -address <address> s.gYGVHcHMiGsCZdKAJzWq1Yj1

 

Or by exporting the VAULT_ADDR variable.

export VAULT_ADDR=https://vault.example.com:8201

 

And the following should be displayed.

Success! You are now authenticated. The token information displayed below
is already stored in the token helper. You do NOT need to run "vault login"
again. Future Vault requests will automatically use this token.

Key                  Value
---                  -----
token                s.gYGVHcHMiGsCZdKAJzWq1Yj1
token_accessor       Z0Q8To48Rkkgx7zka-dqsDjJ
token_duration       ∞
token_renewable      false
token_policies       ["root"]
identity_policies    []
policies             ["root"]

 

And the vault auth list command should return something like this.

~]$ vault auth list
Path      Type     Accessor               Description                Version
----      ----     --------               -----------                -------
token/    token    auth_token_5013c38c    token based credentials    n/a

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 6043bf in the box below so that we can be sure you are a human.