Can someone please give me any insight on how the passwords in /etc/shadow are encrypted? I am attempting to develop a script that will update /etc/shadow with a new user password, but I don't know how the passwords are encrypted/hashed.
Also, is there a way to run /usr/bin/passwd so the password is updated automatically? (That way, I won't have to deal with /etc/shadow at all)
passwd username newpass
New UNIX password: <pw>
Retype new UNIX password: <pw>
Lastly, I looked at the stdin option: "--stdin read new tokens from stdin (root only)"
Is there a way to run passwd --stdin username and then send the new password to passwd through a script?
Thanks in advance.