"Best Way" to inhibit halting of workstations

Mike Raffety sunloop!oconnor!porsche!miker at central.sun.com
Fri Apr 21 20:16:22 AEST 1989


To achieve a secure single-user mode under SunOS 3.X, there's a couple of
ways to do it; the documented, easy, not-quite-perfect way, and the
foolproof, you-need-Unix-source way:

1.  At the tail end of the init(8) man page, in the BUGS section, there's
a documented method.  Unfortunately, I believe you can get around this
simply by INTerrupting at the right moment.  Here's the BUGS section:

------
When coming up single-user, the system does not require the super-user
to log in.  To force a login when running single-user, add the line:

	login root

to the file /.profile.
------

2.  The foolproof way requires Unix source; change init so that when it
comes up single-user, it execs login, instead of sh:

------
fine% scc sccsdiff -r1.1 -r1.2 init.c
23a24
> char  login[] = "/bin/login";
227c228,230
<                       execl(shell, minus, (char *)0);
---
>                       write(2, "Single-user mode...", 20);
>                       execl(login, login, (char *)0);
> /*                    execl(shell, minus, (char *)0);    MVR  */
fine% 
------

The interesting thing about BOTH of these is that login will time out
after 60 seconds, and the machine will continue to come up multi-user.
Note that fsck will NOT have been run when it comes up, since it
originally came up single-user.



More information about the Comp.sys.sun mailing list