Generate htpasswd style passwords without installing apache utilities

This guide applies to most of the Linux operating systems with installed openssl utilities (installed usually by default).

From the command line enter the following command to generate a new user and add the password hash to file .htpasswd in the current directory:

printf “User1:$(openssl passwd -apr1 Passwd56374b)\n” >> .htpasswd

Where User1 is the username, Passwd56374b is the password you prefer. This is it.

Leave a Reply