Skip to content

Instantly share code, notes, and snippets.

@greglecki
Last active May 9, 2019 12:37
Show Gist options
  • Select an option

  • Save greglecki/940f41e7248fbb54e23bfde43903112f to your computer and use it in GitHub Desktop.

Select an option

Save greglecki/940f41e7248fbb54e23bfde43903112f to your computer and use it in GitHub Desktop.
Generate password from Mac terminal

How to generate password from mac terminal

Use openssl command to generate number of pseudo-random bytes, perform base64 encoding and truncate the result to specified number of characters as it will be padded

openssl rand -base64 16 | colrm 17

output: ebT+2wJlhJomwnCy


openssl rand -base64 8

output: hEFxJh0bnkU=


openssl rand -hex 8

output: a0c6c32b2cb54729

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