you can install a tool "pwgen" on linux machines that will generate you passwords, configurable with size and types of characters included.
pwgen -y 40 1
Generates one password with 40 chars, including special chars (-y).
pwgen -y 40 1
Generates one password with 40 chars, including special chars (-y).
head -c 24 /dev/urandom | base64
will give you a password with 24 * 8 = 192 random bits.