[comp.os.minix] Superuser

jeff@questar.QUESTAR.MN.ORG (Jeff Holmes) (12/28/88)

	I had an odd occurance the other day.  I'm not sure
	how it happened but I got my Minix 1.2 system in such
	a state that when I type 'su' it made me root without
	asking for a password.  Logging out reset everything
	to normal.  Anyone had this happen before? The setuid
	bit is set (4755) and su is owned by root.

					Thanks,
					Jeff
-- 
Jeff Holmes	                  DOMAIN: jeff@questar.mn.org 
Questar Data Systems                UUCP: amdahl!bungia!questar!jeff

mju@m-net.UUCP (Marc Unangst) (12/30/88)

In article <1971@questar.QUESTAR.MN.ORG> jeff@questar.QUESTAR.MN.ORG (Jeff Holmes) writes:
>	a state that when I type 'su' it made me root without
>	asking for a password.  Logging out reset everything
>	to normal.  Anyone had this happen before? The setuid
>	bit is set (4755) and su is owned by root.
		    ^^^^      ^^^^^^^^^^^^^^^^^^^
I don't know if this is true for Minix, but for most Unixes, if su
is executed as root, it doesn't ask for a password.  Thus, by making
su SUID root, it is executing as root, and thus (thinking that you are
root) doesn't ask for a password.

-- 
"Don't find a fault, | Marc Unangst
find a remedy."      | UUCP: mju@m-net.ann-arbor.mi.us
  -Henry Ford        | UUCP path: ...!uunet!mailrus!clip!m-net!mju
---------------------+ Internet: mju%m-net%clip@umix.cc.umich.edu

wnp@dcs.UUCP (Wolf N. Paul) (12/30/88)

In article <2662@m2-net.UUCP> mju@m-net.UUCP (Marc Unangst) writes:
|In article <1971@questar.QUESTAR.MN.ORG> jeff@questar.QUESTAR.MN.ORG (Jeff Holmes) writes:
|>	a state that when I type 'su' it made me root without
|>	asking for a password.  Logging out reset everything
|>	to normal.  Anyone had this happen before? The setuid
|>	bit is set (4755) and su is owned by root.
|		    ^^^^      ^^^^^^^^^^^^^^^^^^^
| I don't know if this is true for Minix, but for most Unixes, if su
| is executed as root, it doesn't ask for a password.  Thus, by making
| su SUID root, it is executing as root, and thus (thinking that you are
| root) doesn't ask for a password.

Actually, SU has to be SUID root, or it would not be able to make you root
even if you provided the password. That's where the distinction between the
real and effective UID and GID comes in.

SU runs with effective UID root, but should check your real UID before 
deciding whether to ask for the password.
-- 
Wolf N. Paul * 3387 Sam Rayburn Run * Carrollton TX 75007 * (214) 306-9101
UUCP:     killer!dcs!wnp                 ESL: 62832882
DOMAIN:   dcs!wnp@killer.dallas.tx.us    TLX: 910-380-0585 EES PLANO UD

nagel@paris.ics.uci.edu (Mark Nagel) (12/31/88)

In article <2662@m2-net.UUCP>, mju@m-net (Marc Unangst) writes:
|In article <1971@questar.QUESTAR.MN.ORG> jeff@questar.QUESTAR.MN.ORG (Jeff Holmes) writes:
|>	to normal.  Anyone had this happen before? The setuid
|>	bit is set (4755) and su is owned by root.
|		    ^^^^      ^^^^^^^^^^^^^^^^^^^
|I don't know if this is true for Minix, but for most Unixes, if su
|is executed as root, it doesn't ask for a password.  Thus, by making
|su SUID root, it is executing as root, and thus (thinking that you are
|root) doesn't ask for a password.

Su *has* to be setuid root, or else how could it perform the necessary
setuid for you?  It doesn't ask for a password only when the real uid
is root.

Mark Nagel @ UC Irvine, Dept of Info and Comp Sci
ARPA: nagel@ics.uci.edu              | The world is coming to an end.
UUCP: {sdcsvax,ucbvax}!ucivax!nagel  | Please log off.

allbery@ncoast.UUCP (Brandon S. Allbery) (01/05/89)

As quoted from <2662@m2-net.UUCP> by mju@m-net.UUCP (Marc Unangst):
+---------------
| I don't know if this is true for Minix, but for most Unixes, if su
| is executed as root, it doesn't ask for a password.  Thus, by making
| su SUID root, it is executing as root, and thus (thinking that you are
| root) doesn't ask for a password.
+---------------

Eh wot?  If su ISN'T setuid root, it can't change you TO root, password or
no password!  Try again.

++Brandon
-- 
Brandon S. Allbery, comp.sources.misc moderator and one admin of ncoast PA UN*X
uunet!hal.cwru.edu!ncoast!allbery		    ncoast!allbery@hal.cwru.edu
comp.sources.misc is moving off ncoast -- please do NOT send submissions direct
      Send comp.sources.misc submissions to comp-sources-misc@<backbone>.