root@scw-530499:~# ps -ef |grep -i vault
root 14891 14679 0 20:18 pts/3 00:00:01 ./vault server -config=example.hcl
root 15148 15134 0 20:29 pts/4 00:00:00 grep --color=auto -i vault
root@scw-530499:~#
root@scw-530499:~#
root@scw-530499:~# export VAULT_ADDR=http://0.0.0.0:8200
root@scw-530499:~# ./vault init
Error initializing Vault: Error making API request.
URL: PUT http://0.0.0.0:8200/v1/sys/init
Code: 400. Errors:
* Vault is already initialized
root@scw-530499:~# ./vault auth
Token (will be hidden):
Error validating token: Error making API request.
URL: GET http://0.0.0.0:8200/v1/auth/token/lookup-self
Code: 503. Errors:
* Vault is sealed
root@scw-530499:~# ./vault unseal
Key (will be hidden):
Sealed: true
Key Shares: 5
Key Threshold: 3
Unseal Progress: 1
Unseal Nonce: 6ce54f28-5dc3-989c-4a99-e93e389e772b
root@scw-530499:~# ./vault unseal
Key (will be hidden):
Sealed: true
Key Shares: 5
Key Threshold: 3
Unseal Progress: 2
Unseal Nonce: 6ce54f28-5dc3-989c-4a99-e93e389e772b
root@scw-530499:~# ./vault unseal
Key (will be hidden):
Sealed: false
Key Shares: 5
Key Threshold: 3
Unseal Progress: 0
Unseal Nonce:
root@scw-530499:~#
root@scw-530499:~# ./vault auth
Token (will be hidden):
Successfully authenticated! You are now logged in.
token: 090b5f3c-13fe-32c1-ffa9-234c1b087461
token_duration: 0
token_policies: [root]
root@scw-530499:~#
root@scw-530499:~# ./vault write secret/new \
> password=1234 \
> ttl=1h
Success! Data written to: secret/new
root@scw-530499:~# ./vault read secret/new
Key Value
--- -----
refresh_interval 1h0m0s
password 1234
ttl 1h
root@scw-530499:~# curl \
> -H "X-Vault-Token: $VAULT_TOKEN" \
> -X GET \
> http://127.0.0.1:8200/v1/secret/new
{"request_id":"5faa016f-94e7-6781-cfec-7cd9318322c7","lease_id":"","renewable":false,"lease_duration":3600,"data":{"password":"1234","ttl":"1h"},"wrap_info":null,"warnings":null,"auth":null}
root@scw-530499:~#
even I am able to retrieve from another Server:
[root@co-ps-ntp-a02 ~]# curl -H "X-Vault-Token: 090b5f3c-13fe-32c1-ffa9-234c1b087461" -X GET http://212.47.241.118:8200/v1/secret/new
{"request_id":"20e2130b-cd7e-c630-8e5f-b9d311d81388","lease_id":"","renewable":false,"lease_duration":3600,"data":{"password":"1234","ttl":"1h"},"wrap_info":null,"warnings":null,"auth":null}
[root@co-ps-ntp-a02 ~]#
No comments:
Post a Comment