Random Password from cli/shell

Shuf

using shuf should work in most unix/linux distributions without any installations

Example (20 characters password)

shuf -zer -n20 {a..z} {A..Z} {0..9} ; echo ”

URandom

using /dev/urandom together with tr to delete unwanted characters. For instance, to get only digits and letters and 13 characters

head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13 ; echo ''
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 13 | head -n 1

Leave a Reply

Your email address will not be published. Required fields are marked *