Install pwgen package:
apt-get install pwgen
Then run the following command to generate one password of length 15 and include at least one capital letter, one number and one special character:
pwgen -1 -c -n -y 15
Update (2018-09-23):
For even more secure passwords, you should type the command as follows:
pwgen -1 -c -n -y -s 15
From the man page of pwgen:
-s, –secure
Generate completely random, hard-to-memorize passwords.
These should only be used for machine passwords, since
otherwise it’s almost guaranteed that users will simply
write the password on a piece of paper taped to the mon‐
itor…