Created
June 10, 2015 11:57
-
-
Save Korko/26c0fa18c700f342b88a to your computer and use it in GitHub Desktop.
Generate htpasswd with random password and send it by mail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
password=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 16 | xargs) | |
htpasswd -b /var/ddl.htpasswd korko "$password" | |
echo "Password set to: "$password | mail -s "Password ddl" "korko@localhost" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment