Skip to content

Instantly share code, notes, and snippets.

@bonelifer
Last active February 4, 2016 03:34
Show Gist options
  • Save bonelifer/8b8a8eaa4dbf845282d0 to your computer and use it in GitHub Desktop.
Save bonelifer/8b8a8eaa4dbf845282d0 to your computer and use it in GitHub Desktop.
Automate adding User to passworded lighttpd protected directory
#!/bin/sh
user=$1
realm=$2
pass=$3
hash=`echo -n "$user:$realm:$pass" | md5sum | cut -b -32`
echo "$user:$realm:$hash"
echo "$user:$realm:$hash" >> /etc/lighttpd/.htpasswd/lighttpd-htdigest.user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment