How to make 'htpasswd' print hashed password on stdout
You can use the htpasswd -n flag to make it print the hashed password to stdout instead of writing it to a file.
htpasswd_examples.sh
htpasswd -n usernameor, if you want to use a password given on the command line:
htpasswd_with_password.sh
htpasswd -nb username passwordAnother way is to use /dev/stdout as the output file:
htpasswd_stdout.sh
htpasswd -c /dev/stdout usernameExample output
htpasswd_output.txt
username:$apr1$KwZDqK6Q$Sr6/.MLMv5JUuFPSNY30L/Check out similar posts by category:
Linux
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow