$ dd if=/dev/urandom count=500 bs=1 | tr "\n" " " | sed 's/[^a-zA-Z0-9]//g'or like this
$ dd if=/dev/urandom count=500 bs=1 | md5Then adjust the length by piping the output through cut(1):
... | cut -c-8While the first option is more to type, it generates lower and upper case letters. The second option is easier to type but only generates lower-case passwords.
Update (Dec 12th, 2008): Fixed error. cut(1) must be used, not cat(1).