The following 3-line solution (for generating the MD5 password) seems to work fairly 
well:

makemd5passwd:

#!/usr/bin/perl
$pass="fai";
$saltstring=`makepasswd --chars=8`;
printf("%s\n", crypt("$pass","\$1\$$saltstring"));

It doesn't really need to use makepasswd program (debian makepasswd package) but it is 
a 
pretty cute and useful program as it uses /dev/urandom for generating the salt 
(non-time based). 
Otherwise, would need PERL to generate the random salt...Needless to say it also 
requires PERL 
installed ;-)

Then use makemd5passwd with 'chpass' like so:

echo "root:`makemd5passwd`" | chpasswd -e

This will tell chpasswd program to change the password for the root user to the 
encrypted 
password generated by makemd5passwd.

Alternatively, just use makemd5passwd to generate the string for rootpw= variable in 
DEFAULT.var (maybe fai-setup can do it?) and/or feed it to cfengine to modify 
/etc/shadow in 
hooks.

I still have yet to find out what packages or configuration settings will be needed 
for md5 to be 
enabled.

Senaque
---
E-MAIL: [EMAIL PROTECTED]
IRC: #FAI @ irc.freenode.net
WWW: http://www.sf.net/users/senaque/


Reply via email to