Generating htpasswd file from the command line

February 2, 2011

Recently found a command line utility for automagically generating a .htpasswd file:

Type this command at the prompt:

htpasswd -cmb .htpasswd username password

The arguments are [C]reate the new .htpasswd file if its not there, [m] option forces encryption and [b] allows you to include the user name and password immediately.

AuthType Basic
AuthUserFile /var/www/html/Private/.htpasswd
Require user username

Full guide here: Linux Webserver Tips


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: