Skip to content

Instantly share code, notes, and snippets.

@rujmah
Last active April 21, 2023 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rujmah/5c0e7b1653649d147abb53ed2db4f2d1 to your computer and use it in GitHub Desktop.
Save rujmah/5c0e7b1653649d147abb53ed2db4f2d1 to your computer and use it in GitHub Desktop.
random passwords

Generate Random Passwords

Some command line tools and techniques for generating random strings.

openssl rand -base64 64
# cGuDXUoShzLaAgQSf7TX0trpQ6CtWD5u0VpGyBvGeuoYwFGDs+ZRLIP+TIFGyOln
# 3LYbPyKlHxkLfhiUKgCUSQ==

openssl rand -hex 64
# 4664fd45ca6c87453cdb607b206ab809069848b6b52fc7cb8af44f6d4a3d8eb2e4fc66a018597aa5875b0e70424117c258ce6538f4a41ee190a9accbb67b63c3

cat /dev/urandom | tr -dc 'a-zA-Z0-9-_!@#$%^&*()_+{}|:<>?=' | fold -w 64 | grep -i '[!@#$%^&*()_+{}|:<>?=]' | head -n 1
# o^(ud*t2}r:i$uK|5kPq-az{bb(fW}:IV2fEl5vV6jD<%FHfT8g*YxL4elBh26=k

mkpasswd -l 64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment