From: macomber@thoreau.nsc.com (Robert Macomber)
Subject: Re: Single user booting of DECStations and security
Date: 18 Apr 90 12:48:21 GMT [thread overview]
Message-ID: <44@thoreau.nsc.com> (raw)
In-Reply-To: 1399@bimacs.BITNET
In article <1399@bimacs.BITNET>, yedidya@bimacs.BITNET (Yedidya Israel) writes:
> In article <1990Apr5.123703.2251@maths.tcd.ie> ajudge@maths.tcd.ie (Alan Judge) writes:
>
> Now include these lines in /.profile
>
> echo -n "Single user "
> login root
>
This disussion is really similar to one for SunOS 3.5 last year. That
discussion nixed this idea, because "login" would timeout & die after
a while & leave the user in single-user mode. Assuming that "login"
acts basically the same on pre-4.0 ULTRIX, here's a program that is
intended to be executed from /.profile. If the person booting the
machine in single-user mode can't give the regular root password, it
halts the machine.
---------------------------- Cut Here -----------------------------------
/* singleuser.c
* Christopher Lott 870924
* cml@cis.ohio-state.edu
* written for use in root's .profile
* requests the root passwd from the console; halts unix if it fails
* This program placed in the public domain by the author
*/
#include <pwd.h>
#include <stdio.h>
#include <signal.h>
#include <sys/reboot.h>
#define ROOT_UID 0
main ()
{
char *userword, *rootword, *result, salt[3];
struct passwd *pwentry;
char *crypt(), *getpass();
signal(SIGINT, SIG_IGN);
signal(SIGHUP, SIG_IGN);
signal(SIGQUIT, SIG_IGN);
signal(SIGTSTP, SIG_IGN);
pwentry = getpwuid(ROOT_UID); /* get passwd file entry */
rootword = pwentry->pw_passwd;
salt[0] = rootword[0]; /* grab the salt */
salt[1] = rootword[1];
salt[2] = NULL;
userword = getpass ("Password:"); /* get one from console */
result = crypt(userword, salt);
if ( !(strcmp (result, rootword)) ) {
printf ("hi, root person.\n");
exit (0);
}
else {
printf ("Sorry - halting Unix.\n");
sync();
reboot (RB_HALT);
}
}
---------------------------- Cut Here -----------------------------------
--
Robert L. Macomber
National Semiconductor
South Portland, Maine
macomber@thoreau.nsc.com
next prev parent reply other threads:[~1990-04-18 12:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
1990-04-05 12:37 Single user booting of DECStations and security Alan Judge
1990-04-05 17:06 ` Roland Schemers III
1990-04-17 12:27 ` Yedidya Israel
1990-04-17 16:50 ` Ian! D. Allen [CGL]
1990-04-18 12:48 ` Robert Macomber [this message]
1990-04-19 12:08 ` Yedidya Israel
1990-04-20 22:23 ` Rob Burrowes
1990-04-28 5:03 ` Jason Heirtzler
1990-04-17 19:59 ` Richard Wood
1990-04-17 22:35 ` Eduardo Santiago
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox