dotfiles/bin/htpasswd-entry

9 lines
158 B
Plaintext
Raw Permalink Normal View History

2021-01-10 14:35:15 +00:00
#!/bin/sh
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: $0 <username> <password>"
exit 1
fi
HASHED=$(openssl passwd -apr1 "$2")
echo "$1:$HASHED"