Skip to main content

Access Vault using CLI

Access Vault using CLI

1.The below command will provide you the IP Address of the Vault Server

docker inspect -f '{{.Name}} - {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq)

Identify the above IP Address and set it a VAULT_ADDR variable.

2. Vault CLI determines which Vault servers to send requests using the VAULT_ADDR environment variable.

export VAULT_ADDR='http://IPADDRESSFROMABOVESTEP:8200'

Once you set the VAULT_ADDR variable, now you can check the Status of the Vault Server using Vault Cli

vault status

Save the unseal key somewhere. Don't worry about how to save this securely. For now, just save it anywhere.

Display all the enabled secrets engine.

vault secrets list -detailed