cat /dev/urandom | tr -dc [:print:] | head -c 8A 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.
Notes:
- -c 8 parameter controls the length of the password.
- [:print:] (complexity) can be substituted with [:alpha:][:digit:] for less complex password.