# Using a password in a shell script

**URL:** <https://vaultwarden.discourse.group/t/using-a-password-in-a-shell-script/4203>\
**Category:** Help\
**Created:** [December 6, 2024, 1:54pm UTC](https://vaultwarden.discourse.group/t/using-a-password-in-a-shell-script/4203 "2024-12-06T13:54:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Partridge2562](https://avatars.discourse-cdn.com/v4/letter/p/13edae/32.png) [@Partridge2562](https://vaultwarden.discourse.group/u/Partridge2562)\
**Post date:** [December 6, 2024, 1:54pm UTC](https://vaultwarden.discourse.group/t/using-a-password-in-a-shell-script/4203/1 "2024-12-06T13:54:24Z")

</div>

I have a shell script that accesses a service using a password. What would be a better idea than copying the password from vaultwarden and pasting it in clear text in the script?

The host has docker for vaultwarden so is docker secrets a possibility?

Encrypting the password with openssl into a file and putting the decryption key in clear text in the script is [an idea](https://www.linuxtechi.com/encrypted-password-bash-shell-script/) found by googling.

Can vaultwarden encrypted json export a single entry and can a script decrypt the json file?

---

<div class="post-metadata">

**Author:** ![vermi](https://avatars.discourse-cdn.com/v4/letter/v/a9adbd/32.png) [@vermi](https://vaultwarden.discourse.group/u/vermi)\
**Post date:** [December 10, 2024, 7:27pm UTC](https://vaultwarden.discourse.group/t/using-a-password-in-a-shell-script/4203/2 "2024-12-10T19:27:08Z")

</div>

I recommend Hashicorp Vault for this use case. Scriptable, secure, OS/Free software.

---

<div class="post-metadata">

**Author:** ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)\
**Post date:** [December 10, 2024, 8:53pm UTC](https://vaultwarden.discourse.group/t/using-a-password-in-a-shell-script/4203/3 "2024-12-10T20:53:53Z")

</div>

Or use the Bitwarden CLI either the cli it self, or via the `serve` command.

---

<div class="post-metadata">

**Author:** ![Partridge2562](https://avatars.discourse-cdn.com/v4/letter/p/13edae/32.png) [@Partridge2562](https://vaultwarden.discourse.group/u/Partridge2562)\
**Post date:** [December 13, 2024, 1:14am UTC](https://vaultwarden.discourse.group/t/using-a-password-in-a-shell-script/4203/4 "2024-12-13T01:14:41Z")

</div>

I ended up using [Bitwarden CLI](https://bitwarden.com/help/cli/) which works flawlessly with vaultwarden. I created a new user & vault exclusively for [scripting secrets](https://www.youtube.com/watch?v=7NTFZoDpzbQ) to limit the attack surface.

Hashicorp Vault seems really great but the learning curve is more than I can handle.

Thanks for the tips!

---

<div class="post-metadata">

**Author:** ![Partridge2562](https://avatars.discourse-cdn.com/v4/letter/p/13edae/32.png) [@Partridge2562](https://vaultwarden.discourse.group/u/Partridge2562)\
**Post date:** [February 12, 2026, 6:43pm UTC](https://vaultwarden.discourse.group/t/using-a-password-in-a-shell-script/4203/5 "2026-02-12T18:43:41Z")

</div>

I just saw this tip in the current bw CLI (2026.1.0) help:

Tip: Managing and retrieving secrets for dev environments is easier with Bitwarden Secrets Manager. Learn more [here.](https://bitwarden.com/products/secrets-manager/)

Does anyone know anything about Bitwarden Secrets Manager?

Would it work with the vaultwarden server?

Any advantage to convert a working bw CLI script to Bitwarden Secrets Manager?
