Last active
September 29, 2015 22:38
-
-
Save jachin/1680254 to your computer and use it in GitHub Desktop.
htpasswd reference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a command line too for apache's basic authentication management. | |
# CAUTION: make sure /some/path/to/a/file/named/htpasswd is outside of any directory inside the web root. | |
# To initially create the password | |
htpasswd -c /some/path/to/a/file/named/htpasswd initialUsername | |
# To add another user to the same file | |
htpasswd /some/path/to/a/file/named/htpasswd newUsername | |
# To change an existing user's password | |
htpasswd /some/path/to/a/file/named/htpasswd existingUsername | |
# Add the following to an .htaccess file to protect that directory | |
AuthName "Private zone" | |
AuthType Basic | |
AuthUserFile /some/path/to/a/file/named/htpasswd | |
require valid-user |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment