Professional Documents
Culture Documents
Ex 6
Ex 6
Note: passing -1 will generate an MD5 password, -5 a SHA256 and -6 SHA512 (recommended)
Or you can use the encrypted password with chpasswd. First generate it using this:
perl -e 'print crypt("YourPasswd", "salt", "sha512"),"\n"'
Then later you can use the generated password to update /etc/shadow:
echo "username:encryptedPassWd" | chpasswd -e
The encrypted password we can also use to create a new user with this password, for example:
useradd -p 'encryptedPassWd' username