Created
February 27, 2020 07:55
-
-
Save fonylew/40f7f2dfdd922d42d9e5d3eedabe6c7f to your computer and use it in GitHub Desktop.
Bash Password Generator
This file contains 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
function gen_pass(){ | |
default_len=13 | |
< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-${1:-$default_len}};echo; | |
## OpenSSL random (alternatives: base64) | |
#openssl rand -base64 ${1:-$default_len} | colrm 17 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ref: https://www.howtogeek.com/howto/30184/10-ways-to-generate-a-random-password-from-the-command-line/