Hi
I wonder whether is possible to generate enrypted passwd for some user and paste it into /etc/shadow file ?
What kind of encryption is used in /etc/shadow file ?
ths for help.
Hi
I wonder whether is possible to generate enrypted passwd for some user and paste it into /etc/shadow file ?
What kind of encryption is used in /etc/shadow file ?
ths for help.
for redhat default is md5 hashing
# grep "ENCRYPT_METHOD" /etc/login.defs
MD5
take the password
# read -sre password
after create md5 hashed password
# openssl passwd -1 -salt 9Qj/F.Xw $password
$1$9Qj/F.Xw$TigyWrjyikSFKTX6Zye0t/
-1 for MD5-based password algorithm
-salt for add salt key
for example
# useradd -p `openssl passwd -1 -salt 9Qj/F.Xw $password` mynewuser
# cat /etc/shadow | grep mynewuser
mynewuser:$1$9Qj/F.Xw$TigyWrjyikSFKTX6Zye0t/:14756:0:99999:7:::
Regards
ygemici