Admins usually need to generate some passwords for others, such as when creating a new user in a Linux system. How to generate a password in Shell on Linux?
Several possible and short methods. Here, we generate a password of length 8.
$ pwgen 8 1 dao3PaW9
Password based on base64 (note that the encoding of a 6 char string will be 8 chars in base64) with random numbers generated from various ways.
$ gpg --gen-random -armor 1 6 eXDvMVq2
$ openssl rand -base64 6 1E8oiu5G
$ head -c 6 /dev/urandom | base64 Ilna5Pj8
There are possibly more.