Howtos / Articles

Adding users to a .htpasswd file for Apache

This howto article shows you how to add a new user and password combination to a .htaccess file, for use with the Apache web server. This assumes the Apache tools are installed (specifically the ‘htpasswd’ utility).

In these examples, replace “testuser” and “Pass123″ with the real username and password you wish to add.

(Note: if the .htpasswd file doesn’t already exist, either create it first, or add the -c parameter to htpasswd to automatically create it. If the file exists, and you use -c, it will overwrite the file instead of appending to it.)

Using crypt encryption:

htpasswd -bd .htpasswd testuser Pass123

Using MD5 encryption:

htpasswd -bm .htpasswd testuser Pass123

Using SHA encryption:

htpasswd -bs .htpasswd testuser Pass123


Share this howto article!
  • Facebook
  • Twitter
  • Reddit
  • email

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>