Set Password script for jumpstart Solaris 2.6

2007-12-25 1:14:00

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

Comments

Got something to say?

You must be logged in to post a comment.