Skip to content

Instantly share code, notes, and snippets.

@devx
Last active September 18, 2020 15:47
Show Gist options
  • Save devx/43e5af53adc41b3dbcbb5a0a5aed3c77 to your computer and use it in GitHub Desktop.
Save devx/43e5af53adc41b3dbcbb5a0a5aed3c77 to your computer and use it in GitHub Desktop.
Create htpasswd file with openssl no additional packages to install

add entry to existing htpasswd

User: MyUser, Password: Secrete

printf "MyUser:$(openssl passwd -apr1 Secrete)\n" >> htpasswd

Create a bunch of users with the same password

for i in john jose josh joe ; do
  printf "$i:$(openssl passwd -apr1 Secrete)\n" >> htpasswd
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment