Skip to content

Instantly share code, notes, and snippets.

@androiddrew
Created April 10, 2019 17:35
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 androiddrew/2ef3801a5f0eacfcd3e6bbb2dd76b4a6 to your computer and use it in GitHub Desktop.
Save androiddrew/2ef3801a5f0eacfcd3e6bbb2dd76b4a6 to your computer and use it in GitHub Desktop.
3 Ways to generate random passwords on Linux
# The recommendation is to always use a 14 character password. No clue why so small.
# Strings are in base 64 so you can type them out on a standard keyboard
#### OpenSSL ####
openssl rand 14 -base64
#### pwgen ####
# pwgen has a lot of options. check man pwgen.
# Creates a single password
pwgen 14 1
# Creates a single password with at least one number in the string
pwgen 14 1 -n 1
#### GPG ####
gpg --gen-random --armor 1 14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment