Search code examples
bash.htpasswd

How to automate generation of htpasswd from command line without typing password?


I am trying to automate creating a password from the command line. I have tried the below but it still keeps asking for the password.

echo "test101" | htpasswd -c ~/temp/password admin

How to generate automate htpasswd from command line without typing password?


Solution

  • Why not just use:

    htpasswd -b -c ~/temp/password admin test101