Forked from mccun934/change postgres user password
Last active
March 16, 2018 16:21
-
-
Save jlsherrill/e542f9d01c7f1d94459898ece25d8da3 to your computer and use it in GitHub Desktop.
change postgres user pass
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# EG : ALTER USER Postgres WITH PASSWORD '<newpassword>'; | |
CP_PASS=`grep jpa.config.hibernate.connection.password /etc/candlepin/candlepin.conf | awk -F= '{print $2}'` | |
F_PASS=`grep password /etc/foreman/database.yml | awk -F: '{print $2}' | sed 's/"//g'` | |
echo "ALTER USER candlepin WITH PASSWORD '$CP_PASS';" | sudo -u postgres psql | |
echo "ALTER USER foreman WITH PASSWORD '$F_PASS';" | sudo -u postgres psql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment