From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10b612,9aee0c9e48d0a1a3 X-Google-Attributes: gid10b612,public X-Google-Thread: 1164f8,9aee0c9e48d0a1a3 X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1990-04-18 13:10:09 PST Path: gmdzi!unido!mcsun!uunet!cs.utexas.edu!usc!elroy.jpl.nasa.gov!mahendo!wlbr!voder!thoreau!macomber From: macomber@thoreau.nsc.com (Robert Macomber) Newsgroups: comp.sys.dec,comp.unix.ultrix Subject: Re: Single user booting of DECStations and security Summary: login timeout security hole Keywords: ultrix 3.0 decstation 2100 3100 security Message-ID: <44@thoreau.nsc.com> Date: 18 Apr 90 12:48:21 GMT References: <1990Apr5.123703.2251@maths.tcd.ie> <1399@bimacs.BITNET> Organization: National Semiconductor, S. Portland, Maine Xref: gmdzi comp.sys.dec:2311 comp.unix.ultrix:2681 Posted: Wed Apr 18 13:48:21 1990 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 #include #include #include #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