You can generate encrypted password strings (hashes) using the openssl utility.
You need to supply both a “salt” string and the password you wish to encrypt:
# openssl passwd -1 -salt MoreSalt ThePassword
$1$MoreSalt$Cvu.5MdMq1BjAsFp1oc.f/
The following command line generates a random 8-character salt string:
# openssl rand -base64 6
Combine these into a single command line that uses a different random salt on each invocation:
# openssl passwd -1 -salt $(openssl rand -base64 6) ThePassword
$1$XpOpurgQ$41bulzoCV8viFy37EX6jk.
Read on for a comparison between old crypt()-style passwords and the current md5-style shadow passwords.