Skip to content

Instantly share code, notes, and snippets.

@robertdfrench
Created August 8, 2019 03:00
Show Gist options
  • Save robertdfrench/71d031986f28267dfef6d67bc2a958f2 to your computer and use it in GitHub Desktop.
Save robertdfrench/71d031986f28267dfef6d67bc2a958f2 to your computer and use it in GitHub Desktop.
Request a new entry in an htpasswd database
#!/bin/ksh
# Assume /tmp is memory mapped
(echo -n "robert:"; (openssl rand -base64 48 | tee /tmp/pass)) | htpasswd -I /var/www/authentication.db
cat /tmp/pass && rm /tmp/pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment