How to automate generation of htpasswd from command line without typing password?
If you don't have htpasswd
installed (for example when using nginx) you can generate a password with openssl.
printf "USER:$(openssl passwd -crypt PASSWORD)\n" >> .htpasswd
Why not just use:
htpasswd -b -c ~/temp/password admin test101