Asking for root passwd when booting single user

Henk Boetzkes mcvax!philce!henkbo at uunet.uu.net
Mon Dec 12 14:34:37 AEST 1988


Danielle Heinzer:
>...
> How can I set the system to ask for the root passwd, when booting single
> user ?

It's simple, by (mis)using your /.profile !!!  Let's see if we can make
one ?

#
stty -echo kill u intr u susp u dsusp u quit u stop u
PATH=/etc:/usr/etc:/usr/ucb:/bin:/usr/bin:.
echo ""
echo -n "              Enter password  "
read ans
echo ""
if [ .$ans != ".tulip" ]
	then
echo "";echo "         ILLEGAL USER"
/etc/halt
else stty echo kill \^u intr \^c susp \^z dsusp \^y stop \^s quit \^\\
stty dec
export TERM
echo "password o.k."
fi

So, if we now make an 'chmod 500 /.profile' and we shut the client down
and we do an boot -s, we have to use the password "tulip" to perform an
full single-user boot.

Henk.A.P.A. Boetzkes # E.D.P. N.P.B. Consumer Electronics # PO. BOX 218
5600 MD Eindhoven, The Netherlands # Building SK4, Room 416
+31 40 735983 # !uunet! -> mcvax!philmds!philce!henkbo



More information about the Comp.sys.sun mailing list