Quick-and-dirty Linux password generation May 22, 2023 A quick and dirty way to generate a password on a Linux box: tr -dc '[:print:]' < /dev/urandom | head -c32 32 is the number of characters for the resultant password - beware this will include any possible printable character, including space.