Skip to content

Instantly share code, notes, and snippets.

@davidallsopp
Last active January 3, 2016 13:59
Show Gist options
  • Save davidallsopp/8473473 to your computer and use it in GitHub Desktop.
Save davidallsopp/8473473 to your computer and use it in GitHub Desktop.
Generating secure passwords
head -c 32 /dev/random | base64
# e.g.
# Xv1FnaWlNmMJxs2UYGawn24h4+ueyigZQJEN43hcF44=
# Can also trim the trailing '=' by using head again
# and use echo so we get a newline:
echo $(head -c 32 /dev/random | base64 | head -c 32)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment