I'm trying to create an initial user in my postgresql database on deployment. Apparently I need to generate a pbkdf2:sha1 key of the password that I want for the user.
For example, say I wanted to add an admin account with username "admin" and password "admin" I would need to hash the password "admin" before inserting it into the table I believe.
Can anyone tell me how I might do this in bash, for example, I tried something along these lines but it didn't seem to work:
ADMIN_PASSWORD=admin
openssl dgst -sha1 -hmac "$ADMIN_PASSWORD"
EDIT: This is a password for postgres database, that's why it needs to be hashed before it can be inserted. I want to achieve this hashing in bash and not python.
python -c "from werkzeug.security import generate_password_hash; print generate_password_hash("password")"I'm using python to hash the password but I want to do it in bashopensslor usingpython:) Besides, thegenerate_password_hashinwerkzeugis specific for itself use (e.g. How many iterations) I think. So If you want to generate passwd forwerkzeug, you should use the python code.