I'm trying to implement an automated root password change for our Linux boxes. I'm generating a hash in the script since users will be able to see the contents of the script.
I found that you can pass a hash with the usermod
utility. However, I'm running into a variable substitution issue as seen below.
Example:
# usermod -p $1$0J8av/8N$LIKB2G56XJn2IXp0XzERo1 root # grep root /etc/shadow root:-bashJ8av/8N:15709:0:99999:7:::