Skip to content

Instantly share code, notes, and snippets.

@bsnux
Last active April 22, 2020 17:03
Show Gist options
  • Save bsnux/fcdba8f2b7be62f8b440bb21c68da010 to your computer and use it in GitHub Desktop.
Save bsnux/fcdba8f2b7be62f8b440bb21c68da010 to your computer and use it in GitHub Desktop.
Generate Apache MD5 enc file with openssl for basic HTTP auth
# Reference: https://www.nginx.com/resources/wiki/community/faq/#how-do-i-generate-an-htpasswd-file-without-having-apache-tools-installed
USER="alice"
PW="the_password"
printf "$USER:$(openssl passwd -apr1 $PW)\n" >> .htpasswd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment