Tag Info

New answers tagged


I don't know if there's any reason why you use /dev/random to generate the password, but I would recommend you using pwgen in order to ease your pain. $ pwgen -s 10 1 Where 10 is the length of the password. http://man.cx/pwgen


Consider instead $ dd if=/dev/urandom bs=48 count=1 status=none | base64 imW/X60Sk9TQzl+mdS5PL7sfMy9k/qFBWWkzZjbYJttREsYpzIguWr/uRIhyisR7 This has two advantages: You read only 48 bytes from the random device, not ~8KB; if other processes on the same host need random numbers, 8KB drained all at once can be a serious problem. (Yes, arguably nobody ...


Other people already pointed out that locale determines what [:print:] means. However, not all printable characters are suitable for passwords (not even in ascii). You really don't want spaces, tabs, and #$%^? in your password - it's not just difficult to remember, it's also potentially dangerous to the underlying authentication system, may be impossible to ...


What about tr -dc [:print:] < /dev/urandom | head -c 64 | strings strings should print the output of urandom in a printable format


It's your locale and tr problem. Currently, GNU tr fully supports only single-byte characters. So in locales using multibyte encodings, the output can be weird: $ </dev/urandom LC_ALL=vi_VN.tcvn tr -dc '[:print:]' | head -c 64 `�pv���Z����c�ox"�O���%�YR��F�>��췔��ovȪ������^,<H ���> If you want it to be stable, you must set the locale: $ ...

Top 50 recent answers are included