Linux create salted password
Method 1
openssl passwd -1 -salt xyz yourpass
Method 2
makepasswd –clearfrom=- –crypt-md5 <<< YourPass
Method 3
echo "username:password" | chpasswd
Or you can use encrypted password with chpasswd first generate it using :
perl -e 'print crypt("YourPasswd", "salt"),"\n"'
then later you can use generated password to update
echo "username:encryptedPassWd" | chpasswd -e
this encrypted password we can use to create new user with password
Ex.
useradd -p 'encryptedPassWd' username
Method 4
echo -e "md5crypt\npassword" | grub | grep -o "\$1.*"