On Ubuntu 9.04 (jaunty) I had been generating and setting the root password in a bootstrapping script using:
# Generated MD5 encrypted password
/usr/bin/openssl passwd -1
# Set the password
/bin/echo 'root:ENCRYPTED_PASSWORD' | /usr/sbin/chpasswd -e
With shadow 4.1.4, chpasswd now uses PAM, and has dropped the -e option used above, as well as the -c option that I’d used to generate sha512 encrypted passwords. You’ll want to use mkpasswd from the whois package (yeah, weird) for that now, such as:
mkpasswd -m sha-512 -s
The password can be presented to useradd / usermod in encrypted format, such as:
/usr/sbin/useradd -m -p 'ENCRYPTED_PASSWORD' -G admin -s /bin/bash toor
Both this and your earlier post at http://blog.loftninjas.org/2009/03/11/generating-sha512-passwords/ have been extremely helpful for me. Just wanted to let you know that and please continue to create newer posts on the same subject as needed when new Ubuntu releases come out (with a link on the previously newest post pointing to the now newest post). Thank you!