Set Password script for jumpstart Solaris 2.6

From: Alexander Frost (afrost@citadel.com)
Date: Sat May 10 2003 - 13:32:13 EDT


I have the below code in my finish script. The finish script runs during
the end of the jumpstart, but when the machine reboots it asks me for
roots password. No matter what I enter Root does have the password that
is entered in the script, so the actually setting of the password is not
then problem but I don't understand why it still asks me for the passwd
after reboot, the end of the script is suppose to stop it from doing
that and it does work on Sol 7, 8, and 9 but not on 2.6.... what am I
missing??

Thank you

Lex

-----------------------------
# set the root password
PASSWD=OgffgngffddEFtIE

# create a temporary input file
cp /a/etc/shadow /a/etc/shadow.orig

nawk -F: '{
        if ( $1 == "root" )

printf"%s:%s:%s:%s:%s:%s:%s:%s:%s\n",$1,passwd,$3,$4,$5,$6,$7,$8,$9
        else

printf"%s:%s:%s:%s:%s:%s:%s:%s:%s\n",$1,$2,$3,$4,$5,$6,$7,$8,$9
        }' passwd="$PASSWD" /a/etc/shadow.orig > /a/etc/shadow

# reset the permissions on the new /etc/shadow file to whatever is was
# set to during the install
perm=`grep '^/etc/shadow e' /a/var/sadm/install/contents | (read f1 f2
f3 f4 f5
; echo $f4)`
chmod $perm /a/etc/shadow

# remove the temporary file
rm -f /a/etc/shadow.orig

# set the flag so sysidroot won't prompt for the root password
sed -e 's/0 # root/1 # root/' ${SI_SYS_STATE} > /tmp/state.$$
mv /tmp/state.$$ ${SI_SYS_STATE}

#end of script
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:26:23 EDT