vault server -dev
Installation of Vault
- vault --version
Starting Vault
vault server -dev
WARNING! dev mode is enabled! In this mode, Vault runs entirely in-memory and starts unsealed with a single unseal key. The root token is already authenticated to the CLI, so you can immediately begin using Vault.
You may need to set the following environment variables:
$ export VAULT_ADDR='http://127.0.0.1:8200'
The unseal key and root token are displayed below in case you want to seal/unseal the Vault or re-authenticate.
Unseal Key: CqmQ3v0KL0zKkWwStvZRYPtYGiNXIcsyggrcRkaI1wo= Root Token: hvs.a34RyiugUmwu4gbpj53dzgzL
Export the varialbes
export VAULT_ADDR='http://
export VAULT_TOKEN='hvs.a34RyiugUmwu4gbpj53dzgzL'
1997 export VAULT_ADDR='http://127.0.0.1:8200 (opens in a new tab)' 1998 export VAULT_TOKEN='hvs.a34RyiugUmwu4gbpj53dzgzL' 1999 vault status 2000 v 2001 nano .bashrc 2002 source .bashrc 2003 v 2004 # v kv put my/path key1=value1 2005 v secrets enable -path=mypath kv 2006 v kv get mypath/secret1 2007 v kv get -format=json mypath/secret1 2008 v secrets list 2009 v kv get -format=json mypath/secret 2010 v secrets list 2011 v kv delete mypath/secret 2012 v secrets list 2013 v kv delete mypath 2014 v secrets list 2015 v kv delete mypath/secret 2016 v kv delete mypath/secret1 2017 v secrets list 2018 v kv get -format=json mypath/secret 2019 v secret list 2020 v secrets list 2021 v secrets enable --path=aws aws 2022 v secrets list 2023 v secrets disable aws 2024 v secrets list 2025 v secrets disable mysecret 2026 v secrets list 2027 v secrets disable mypath 2028 v secrets list 2029 v secrets enable --path=aws aws 2030 v secrets list 2031 v login 2032 v token create 2033 v login 2034 v token list 2035 v token revoke hvs.35NnL8zBnMwhzm4hxSe1H16d 2036 v login 2037 v auth list 2038 v auth enable github 2039 v auth list 2040 v token revoke -mode path auth/github 2041 v auth list 2042 v auth disable guthub 2043 v auth disable github 2044 v auth list 2045 history devops@devops@T_23:22@M_47.27%%@[~] ~
PROD
unset VAULT_TOKEN
#config.hcl
storage "raft" {
path = "./vault/data"
node_id = "node1"
}
listener "tcp" {
address = "0.0.0.0:8200"
tls_disable = "true"
}
api_addr = "http://127.0.0.1:8200"
cluster_addr = "https://127.0.0.1:8201"
ui = true
Start Vault in production mode
export VAULT_ADDR='http://127.0.0.1:8200'
vault server -config=config.hcl
Initialize Vault
# export VAULT_ADDR='http://127.0.0.1:8200'
devops@devops@T_23:34@M_47.54%%@[~] ~
# v operator init
Unseal Key 1: li6FCOAxm9XofBAqU8hCSvwOpWplhY9VcmjouVi0I/VU
Unseal Key 2: Ti/zjoCKAt3vC+MvuDjH7GK0Ajwq/+Ag1L452bgCvOHi
Unseal Key 3: NJ3fnnKAV81pV6aSOzv3+7QNEs7WsLpRLZ+t+aJGMvGx
Unseal Key 4: 7i2z7fMATNqu0xh5zEu7KI6ti96XdRR3oWtr495vkeuG
Unseal Key 5: PLBxgLSJaMQuyqL4GW94f4xuPz/4DZF0hmD4PYlND0Bo
Initial Root Token: hvs.TCz0Sgk7xCpqbYPwecOZJKy6
Vault initialized with 5 key shares and a key threshold of 3. Please securely
distribute the key shares printed above. When the Vault is re-sealed,
restarted, or stopped, you must supply at least 3 of these keys to unseal it
before it can start servicing requests.
Vault does not store the generated root key. Without at least 3 keys to
reconstruct the root key, Vault will remain permanently sealed!
It is possible to generate new unseal keys, provided you have a quorum of
existing unseal keys shares. See "vault operator rekey" for more information.
devops@devops@T_23:34@M_47.47%%@[~] ~