Sunday, November 18, 2018

Generate a psuedo random password

How to generate a psuedo random password fast via the command line with OpenSSL


To generates a number of random bytes, which can either be output raw, as Base64 or as HEX. The Base64 output is a good password most of the time.

# Base64
openssl rand -base64 NUMBER
# HEX
openssl rand -hex NUMBER

Example:
[root@dfdf41f1677a /]# openssl rand -base64 48
dsXjXy2Jbz0uX5cSqmzd0K27uEM/++2Wjzlm3ohhuvMB5dOQzpm/zPv+ANyNPfYB