Here’s 10 ways to generate random password:
For any of these random password commands, you can either modify them to output a different password length, or you can just use the first n characters of the generated password if you don’t want such a long password.
This method uses SHA to hash the date, runs through base64, and then outputs the top 32 characters.
date +%s | sha256sum | base64 | head -c 32 ; echo
This method used built-in /dev/urandom feature, and filter out only characters that you would normally use in a password. Then it outputs the top 32 characters.
< /dev/urandom tr …