244 lines
8.9 KiB
HTML
244 lines
8.9 KiB
HTML
<!--startcut ======================================================= -->
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
<html>
|
|
<head>
|
|
<META NAME="generator" CONTENT="lgazmail v1.3C.e">
|
|
<TITLE>The Answer Guy 51: Removing an OS</TITLE>
|
|
</HEAD><BODY BGCOLOR="#FFFFFF" TEXT="#000000"
|
|
LINK="#3366FF" VLINK="#A000A0">
|
|
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
|
<H4>"The Linux Gazette...<I>making Linux just a little more fun!</I>"</H4>
|
|
<P> <hr> <P>
|
|
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
|
<center>
|
|
<H1><A NAME="answer">
|
|
<img src="../../gx/dennis/qbubble.gif" alt="(?)"
|
|
border="0" align="middle">
|
|
<font color="#B03060">The Answer Guy</font>
|
|
<img src="../../gx/dennis/bbubble.gif" alt="(!)"
|
|
border="0" align="middle">
|
|
</A></H1>
|
|
<BR>
|
|
<H4>By James T. Dennis,
|
|
<a href="mailto:linux-questions-only@ssc.com">linux-questions-only@ssc.com</a><BR>
|
|
LinuxCare,
|
|
<A HREF="http://www.linuxcare.com/">http://www.linuxcare.com/</A>
|
|
</H4>
|
|
</center>
|
|
|
|
<p><hr><p>
|
|
<!-- endcut ======================================================= -->
|
|
<!-- begin 2 -->
|
|
<H3 align="left"><img src="../../gx/dennis/qbubble.gif"
|
|
height="50" width="60" alt="(?) " border="0"
|
|
>Removing an OS</H3>
|
|
|
|
|
|
<p><strong>From Paully0529 on Sun, 30 Jan 2000
|
|
</strong></p>
|
|
<!-- ::
|
|
Removing an OS
|
|
~~~~~~~~~~~~~~
|
|
:: -->
|
|
<P><STRONG>
|
|
I recently received a laptop which has <A HREF="http://www.redhat.com/">Red Hat</A> 5.1 installed on it. I would
|
|
like to remove this OS but have no idea what the login password is.
|
|
Is there any way around this?
|
|
</STRONG></P>
|
|
<BLOCKQUOTE><IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
|
|
HEIGHT="28" WIDTH="50" BORDER="0"
|
|
>
|
|
You don't need a user/account password to remove any
|
|
operating system. So long as you can control the boot
|
|
sequence of the system (i.e. boot from floppy or CD)
|
|
then you can boot up into something that will wipe out
|
|
all that nasty stuff that you don't want on your new
|
|
laptop's hard disk.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
There are also ways for you do force a password change
|
|
on a Linux box. I've described it several times
|
|
--- but the basic sequence is something like this:
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
At the LILO: prompt type:
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE><BlockQuote><code>
|
|
linux init=/bin/sh rw
|
|
</code></BlockQuote></BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
... this will boot the system using the "linux" LILO
|
|
stanza, and force the kernel to bypass the normal
|
|
bootup process (by loading a command shell instead of
|
|
the usual init process). It will also force the kernel
|
|
to mount it's "root" filesystem in "read/write" mode.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
You can then type:
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE><BlockQuote><code>
|
|
mount /usr
|
|
</code></BlockQuote></BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
... which might not be necessary, and thus might
|
|
give a (harmless) error message.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
Then type:
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE><BlockQuote><code>
|
|
/usr/bin/passwd
|
|
</code></BlockQuote></BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
... and provide a new password (which you'll need to
|
|
repeat twice).
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
Next you can type the following commands (ignoring
|
|
some possible, harmless warnings and errors):
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE><BlockQuote><pre>
|
|
sync
|
|
umount /usr
|
|
mount -o remount,ro /
|
|
exec /sbin/init 6
|
|
</pre></BlockQuote></BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
Of course those directions are for people who want
|
|
to take over a Linux system and preserve the
|
|
programs, configuration and data on it. In your case
|
|
you could do something more like the following at the
|
|
LILO prompt:
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE><BlockQuote><code>
|
|
linux init=/bin/sh rw
|
|
</code></BlockQuote></BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
... and when you get a shell prompt just use:
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE><BlockQuote><code>
|
|
dd if=/dev/zero of=/dev/hda
|
|
</code></BlockQuote></BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
... (assuming that Linux is on your primary IDE drive).
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
NOTE: This last command example will WIPE OUT EVERYTHING
|
|
ON YOUR PRIMARY IDE DRIVE! It will scribble strings
|
|
of binary zeros (ASCII NUL characters) all over the
|
|
drive wiping out everything. Don't use this unless that's
|
|
really what you want to do!
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
(Note: one some systems you might have to use some
|
|
other "stanza" name other than "linux" --- hit a
|
|
[Tab] key at the LILO prompt to see a list of options).
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
SysAdmins Note: If you want to prevent users from
|
|
doing these sorts of things to their desktop systems
|
|
(as a matter of policy for example) then you can set
|
|
up a LILO password and mark the system as "restricted"
|
|
in the <TT>/etc/lilo.conf</TT> file.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
Of course this by itself will not be much "protection" --
|
|
you'll also have to mark the file as not readable by users
|
|
other than root, restrict root access to the system, change
|
|
the CMOS boot sequence to prevent booting from floppies, CD
|
|
discs and other removable media, and set a CMOS/NVRAM
|
|
password to prevent the users from changing the boot
|
|
sequences back. On top of all that you'll have to pick a
|
|
brand of PC/BIOS that doesn't have any known "backdoor" CMOS
|
|
passwords and you'll have to lock the cases so that the
|
|
users can't open them up to short the battery to clock chip
|
|
leads, or otherwise reset the CMOS registers to their
|
|
factory state. Those are all hardware security limitations
|
|
of PCs, Macintosh and many of the other workstations. They
|
|
are not OS specific issues.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
With most operating systems, you can boot up off their
|
|
installation media and readily wipe out whatever happens
|
|
to be sitting on the system by simply answer some silly
|
|
install program warning. (Early versions of MS-DOS were
|
|
pretty stupid in that they would refuse to remove or
|
|
overwrite "foreign" or "unknown" partitions in FDISK
|
|
regardless of a users wishes. I don't know if they
|
|
ever fixed that. I haven't installed any MS operating
|
|
system on anything for several years).
|
|
</BLOCKQUOTE>
|
|
|
|
<!-- sig -->
|
|
|
|
|
|
<!-- end 2 -->
|
|
<!--startcut ======================================================= -->
|
|
<P> <hr> <P>
|
|
<H5 align="center"><a href="http://www.linuxgazette.com/copying.html"
|
|
>Copyright ©</a> 2000, James T. Dennis
|
|
<BR>Published in <I>The Linux Gazette</I> Issue 51 March 2000</H5>
|
|
<H6 ALIGN="center">HTML transformation by
|
|
<A HREF="mailto:star@tuxtops.com">Heather Stern</a> of
|
|
Tuxtops, Inc.,
|
|
<A HREF="http://www.tuxtops.com/">http://www.tuxtops.com/</A>
|
|
</H6>
|
|
<P> <hr> <P>
|
|
<!-- begin tagnav ::::::::::::::::::::::::::::::::::::::::::::::::::-->
|
|
<TABLE WIDTH="95%"><TR VALIGN="center" ALIGN="center">
|
|
<TD colspan="2" rowspan="2"><A
|
|
HREF="../lg_answer51.html"
|
|
><IMG SRC="../../gx/dennis/answernew.gif"
|
|
ALT="[ Answer Guy Current Index ]"></A>
|
|
<TD colspan="2" rowspan="2"><A
|
|
HREF="../../tag/kb.html"
|
|
><IMG SRC="../../gx/dennis/answertoc.gif"
|
|
ALT="[ Index of Past Answers ]"></A></td>
|
|
<TD WIDTH="11%"><A HREF="../lg_answer51.html#greeting"><img
|
|
src="../../gx/dennis/smily.gif" alt="greetings" border="0"></A></TD>
|
|
<TD WIDTH="11%"><A HREF="1.html">1</A></TD>
|
|
<TD WIDTH="11%"><A HREF="2.html">2</A></TD>
|
|
<TD WIDTH="11%"><A HREF="3.html">3</A></TD>
|
|
<TD WIDTH="11%"><A HREF="4.html">5</A></TD>
|
|
</TR><TR VALIGN="center" ALIGN="center">
|
|
<TD WIDTH="11%"><A HREF="5.html">5</A></TD>
|
|
<TD WIDTH="11%"><A HREF="6.html">6</A></TD>
|
|
<TD WIDTH="11%"><A HREF="7.html">7</A></TD>
|
|
<TD WIDTH="11%"><A HREF="8.html">8</A></TD>
|
|
<TD WIDTH="11%"><A HREF="9.html">9</A></TD>
|
|
</TR><TR VALIGN="center" ALIGN="center">
|
|
<TD WIDTH="10%"><A HREF="10.html">10</A></TD>
|
|
<TD WIDTH="10%"><A HREF="11.html">11</A></TD>
|
|
<TD WIDTH="10%"><A HREF="12.html">12</A></TD>
|
|
<TD WIDTH="10%"><A HREF="13.html">13</A></TD>
|
|
<TD WIDTH="11%"><A HREF="14.html">14</A></TD>
|
|
<TD WIDTH="11%"><A HREF="15.html">15</A></TD>
|
|
<TD WIDTH="11%"><A HREF="16.html">16</A></TD>
|
|
<TD WIDTH="11%"><A HREF="17.html">17</A></TD>
|
|
</TR><TR VALIGN="center" ALIGN="center">
|
|
<TD WIDTH="10%"><A HREF="18.html">18</A></TD>
|
|
<TD WIDTH="10%"><A HREF="19.html">19</A></TD>
|
|
<TD WIDTH="10%"><A HREF="20.html">20</A></TD>
|
|
<TD WIDTH="10%"><A HREF="21.html">21</A></TD>
|
|
<TD WIDTH="11%"><A HREF="22.html">22</A></TD>
|
|
</TR></TABLE>
|
|
</TR><TR VALIGN="center" ALIGN="center">
|
|
<!-- end tagnav ::::::::::::::::::::::::::::::::::::::::::::::::::::-->
|
|
<P> <hr> <P>
|
|
<!-- begin lgnav ::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
|
<A HREF="../index.html"
|
|
><IMG SRC="../../gx/indexnew.gif" ALT="[ Table Of Contents ]"></A>
|
|
<A HREF="../../index.html"
|
|
><IMG SRC="../../gx/homenew.gif" ALT="[ Front Page ]"></A>
|
|
<A HREF="../lg_bytes51.html"
|
|
><IMG SRC="../../gx/back2.gif" ALT="[ Previous Section ]"></A>
|
|
<A HREF="../../faq/index.html"
|
|
><IMG SRC="../../gx/dennis/faq.gif"
|
|
ALT="[ Linux Gazette FAQ ]"></A>
|
|
<A HREF="../lg_tips51.html"
|
|
><IMG SRC="../../gx/fwd.gif" ALT="[ Next Section ]"></A>
|
|
<!-- end lgnav ::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
|
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
|
</BODY></HTML>
|
|
<!--endcut ========================================================= -->
|