Skip to content

Instantly share code, notes, and snippets.

@tamboer
Last active December 19, 2015 09:28
Show Gist options
  • Select an option

  • Save tamboer/5932759 to your computer and use it in GitHub Desktop.

Select an option

Save tamboer/5932759 to your computer and use it in GitHub Desktop.
apache .htaccess .htpasswd
#.htaccess
AuthName "Restricted Area"
AuthType Basic
AuthUserFile /var/www/path to /public_html/.htpasswd
AuthGroupFile /dev/null
require valid-user
#.htpasswd
username:decrypted pass
FROM : http://stackoverflow.com/questions/4175707/adding-a-salt-to-htpasswd
By default htpasswd uses the standard crypt function and thus passwords are already salted - note in this example that both users have the same password yet the hashes are different:
simon@diablo:~$ htpasswd -b -c htpasswd simon abcd
Adding password for user simon
simon@diablo:~$ htpasswd -b htpasswd simon2 abcd
Adding password for user simon2
simon@diablo:~$ cat htpasswd
simon:NWvm/LCCxQ64E
simon2:2I.LBzsRqULN6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment