# Password from environment - liquibase command line

**URL:** <https://forum.liquibase.org/t/password-from-environment-liquibase-command-line/5403>\
**Category:** General Discussion\
**Created:** [April 30, 2021, 12:38pm UTC](https://forum.liquibase.org/t/password-from-environment-liquibase-command-line/5403 "2021-04-30T12:38:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nodule](https://avatars.discourse-cdn.com/v4/letter/n/ed8c4c/32.png) [@nodule](https://forum.liquibase.org/u/nodule)\
**Post date:** [April 30, 2021, 12:38pm UTC](https://forum.liquibase.org/t/password-from-environment-liquibase-command-line/5403/1 "2021-04-30T12:38:24Z")

</div>

Hello,

For most of our scripts, we use environment variables to pass secrets to programs. We would rather this than having them in command line parameters or in files on disk.

However, with liquibase command line, it doesn’t seem to be possible to pass the “password” parameter as an environment variable (either directly, or using the JAVA\_OPTS=-D approach).

Am I completely missing something here, or should I raise a bug?

Chris

---

<div class="post-metadata">

**Author:** ![daryldoak](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/daryldoak/32/764_2.png) [@daryldoak](https://forum.liquibase.org/u/daryldoak)\
**Post date:** [April 30, 2021, 12:50pm UTC](https://forum.liquibase.org/t/password-from-environment-liquibase-command-line/5403/2 "2021-04-30T12:50:58Z")

</div>

For my Liquibase implementation, I dynamically write the liquibase properties file, containing the username and password via environment variables, that way they do not show if someone runs a ps command. Then I use the “–defaultsFile” when I run the Liquibase CLI.

---

<div class="post-metadata">

**Author:** ![nodule](https://avatars.discourse-cdn.com/v4/letter/n/ed8c4c/32.png) [@nodule](https://forum.liquibase.org/u/nodule)\
**Post date:** [May 2, 2021, 11:49am UTC](https://forum.liquibase.org/t/password-from-environment-liquibase-command-line/5403/3 "2021-05-02T11:49:02Z")

</div>

Thanks - I guess this could be an enhancement request, then…?

---

<div class="post-metadata">

**Author:** ![SteveInAustin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/steveinaustin/32/345_2.png) [@SteveInAustin](https://forum.liquibase.org/u/SteveInAustin)\
**Post date:** [May 3, 2021, 2:00pm UTC](https://forum.liquibase.org/t/password-from-environment-liquibase-command-line/5403/4 "2021-05-03T14:00:11Z")

</div>

If you do submit an enhancement request, please describe what you want in more detail. It isn’t clear from the question how you are passing environment variables in or what problem you are getting. Is this on Windows or a Unix-like platform? Are you expecting Liquibase to expand the environment variable or the shell?

---

<div class="post-metadata">

**Author:** ![rakhi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/rakhi/32/288_2.png) [@rakhi](https://forum.liquibase.org/u/rakhi)\
**Post date:** [May 6, 2021, 9:08am UTC](https://forum.liquibase.org/t/password-from-environment-liquibase-command-line/5403/5 "2021-05-06T09:08:07Z")

</div>

Hi @nodule ,

I agree and support @daryldoak 's answer here. Even in my Liquibase implementation, I’m writing the username and password dynamically to the properties file. So it completely depends on the approach you follow. I don’t think it as any bug or enhancement to be done.

Please let us know if any doubts or queries.

Thanks!  
Rakhi Agrawal
