Brain Teaser

Mithrandir wchuang at athena.mit.edu
Sat Oct 6 14:14:14 AEST 1990


In article <Oct90.150551.3649 at x.co.uk> mike at x.co.uk (Mike Moore) writes:
>Here's one (do NOT actually do this, it appears to be lethal):
>
>  mv /bin/sh /bin/sh.bin
>
>create a shell script called /bin/sh with the following
>
>if [ $USER = "root" ]
>  then
>    /bin/sh.bin
>  else
>    /bin/rsh
>fi
>
>log out and log back in (assuming that your passwd file has you set to
>use /bin/sh
>
>you can't (can't exec a shell of course).
>
>now assume that *everyone* is set to use /bin/sh (including root), how
>do you get out of this without rebuilding the operating system?  I don't
>think there actually is one..... but....
>
>Mike Moore
>mike at x.co.uk or mike at ixi-limited.co.uk
>Usual and obvious disclaimers... etc

Reboot the workstation, enter single-user mode and move /bin/sh.bin back
to /bin/sh.


--
---------------------------------------------William Chuang  MIT '91
ARPA:    wchuang at athena.mit.edu
BITNET:  wchuang%athena.mit.edu at MITVMA.BITNET
UUCP:    ...!mit-eddie!athena.mit.edu!wchuang



More information about the Comp.unix.misc mailing list