May 2009
If the cleartext password is known (e.g. when generating temporary student accounts), the printable hash to go in /etc/shadow
can be generated like this:
USERSHADOW=$(perl -e "use Crypt::PasswdMD5; print unix_md5_crypt(${USERPASSWD}, $(( ${RANDOM} % 4096)) );")
Note | |
---|---|
Of course, ${RANDOM} works because we are using a |