Created
March 24, 2022 22:11
-
-
Save dathanb/73c652b4a1f9eda3bd12c148709c8e77 to your computer and use it in GitHub Desktop.
Generate a random password from the command line
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
length=40 | |
forbiddenChars="+*/^" | |
openssl rand 4096 | \ | |
LC_ALL=C tr -cd '[:alnum:][:punct:]' | \ | |
tr -d "${forbiddenChars}" | \ | |
fold -w "${length}" | \ | |
head -n 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment