Skip to content

Instantly share code, notes, and snippets.

@jachin
Created July 13, 2011 19:05
Show Gist options
  • Save jachin/1081057 to your computer and use it in GitHub Desktop.
Save jachin/1081057 to your computer and use it in GitHub Desktop.
Setting up Apache2 Username/Password

Initial Create

htpasswd -c /usr/local/apache/passwd/passwords rbowen

This will create a new username/password file at /usr/local/apache/passwd/passwords with the username rbowen. It will then ask you to enter a password and confirm it.

Do not do this if you already have a password file. The -c option is for creating a new file.

Adding More Users

htpasswd /usr/local/apache/passwd/passwords dpitts

This will add the user dpitts to the username/password file at /usr/local/apache/passwd/passwords.

More Information

http://httpd.apache.org/docs/2.0/howto/auth.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment