Linux provides built-in functionality to generate secure passwords with a few (piped) commands:
cat /dev/urandom | tr -dc [:print:] | head -c 8
A special file /dev/urandom provides an interface to a Linux kernel random number generator which gathers environmental noise from device drivers and other sources into an entropy pool.
- -c 8 parameter controls the length of the password.
- [:print:] (complexity) can be substituted with [:alpha:][:digit:] for less complex password.