[comp.sys.sun] Asking for root passwd when booting single use

barnett@uunet.uu.net (Bruce Barnett) (12/17/88)

galvin-peter@cs.yale.edu (Peter Baer Galvin):
>	On "lesser" versions, you can put the command
>		login root
>	as the first line of the file /.profile but only if root uses the csh
>	shell by default. 

If you value your disk DO NOT DO THIS!

I covered this in sunspots v6n24, and in that issue included the program
lockup.c that should be executed in  /.profile instead of "login root".

The problem with the above scheme is if you get a power failure or a
crash, the system reboots and then:

	runs fsck, which fails
	goes to single user boot
	executes /.profile
	executes login root
	WHEN ROOT DOES NOT LOG IN WITHIN A CERTAIN PERIOD OF TIME,
		LOGIN TIMES OUT AND EXITS.
	the single user shell terminates, and the system boots up
		multi-user WITHOUT FIXING THE DISK!

The more your system crashes, the more corrupt your disk becomes.

Therefore - do NOT add "login root" to /.profile.
--
Bruce G. Barnett  <barnett@ge-crd.ARPA> <barnett@steinmetz.ge.com>
		uunet!steinmetz!barnett

galvin-peter@cs.yale.edu (Peter Baer Galvin) (12/30/88)

I said:
>       On "lesser" versions, you can put the command
>               login root
>       as the first line of the file /.profile but only if root uses the csh
>       shell by default.

Bruce Barnett said:
> If you value your disk DO NOT DO THIS!

I pointed this out in my original posting, but I guess Bruce decided not
to include that in his quote.  At any rate, it does have the potential to
be a problem.  He have 70 sun workstation and 7 servers here and ran in
this configuration for 6 months or so without any problems, so I don't
think a blanket "dont do this" is appropriate.  If your workstation's disk
nd partition gets trashed just shut it down and fsck the nd partition from
the server. (fsck /dev/ndlX, where X depends on the contents of you
nd.local file.)  If that doesn't fix the problem you can always use "dd"
to copy the contents of another workstations nd partition over the
"broken" contents (assuming the nd's are the same size, as they are here).

In short you should be aware the risks and evaluate them against the
security gain at your site.  And I try not to give advice that will cause
your disk to be trashed!

	--Peter

Peter Baer Galvin       		      (203)432-1254
Senior Systems Programmer, Yale Univ. C.S.    galvin-peter@cs.yale.edu
51 Prospect St, P.O.Box 2158, Yale Station    ucbvax!decvax!yale!galvin-peter
New Haven, Ct   06457			      galvin-peter@yalecs.bitnet