Skip to content

Instantly share code, notes, and snippets.

@zinovyev
Created September 30, 2018 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zinovyev/71e8ca7e50f713f14b98ccd60a99588a to your computer and use it in GitHub Desktop.
Save zinovyev/71e8ca7e50f713f14b98ccd60a99588a to your computer and use it in GitHub Desktop.
Save it to excutable PATH and use command similar to htpasswd without need to have Apache installed
#!/usr/bin/env bash
USER=$1
PASSWORD=$2
HTPASSWD=$3
printf "$USER:$(openssl passwd -crypt $PASSWORD)\n" >> $HTPASSWD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment