Sometimes you have to create a password-hash for the shadow-file. Here is an easy way to do it:
Method 1 (better suitable for scripting – passwort is visible)
openssl passwd -6 -salt xyz yourpass
Method 2 (you enter in the PW – no clear text to see)
mkpasswd --method=SHA-512 --stdin
Note:
passing -1
will generate an MD5 password, -5
a SHA256 and -6
SHA512 (recommended)
The option --method
accepts md5
, sha-256
and sha-512
source: [stackexchange]