Saturday, March 04, 2006

How to use NT bootloader to boot Linux

Assuming that you are having a dual boot with Linux/Windows OS installed.

You do not want to use the Linux Boot Loader Grub/Lilo.

Reason being : When you delete your Linux you might encounter
the problem where you can’t boot Windows anymore because MBR
is pointing to GRUB or LILO which you have erased or it corrupted
because you have set something wrong.One way to get through this
is to use ntbootloader (default bootloader for windows).

Note : Make sure that you install linux boot loader (GRUB or LILO) in the first sector of Linux Boot partition ( /boot ) or it wouldn’t work at all.

Requirement:-

Windows XP Home or Professional Edition

Windows NT 4.0 or later

GRUB or LILO boot loader(any other Linux boot loader) must
be installed in first sector of Linux Boot partition to do you have
to change make you linux installation to install the boot information
in you linux boot partition (/boot) not the MBR (**Very important).

A Linux Boot Disk

When you have all the above requirements then follow the instruction
below :-

1) Insert you Linux Boot Disk into floppy drive then boot your system.

2) when you successfully boot into linux then launch a console.

3) Type in this command (without the” #”)

# dd if=/dev/
hdaXX bs-512 count=1 of=/mnt/floppy/bootsect.lin

4)
hdaXX is your /boot partition. if your /boot partition is at /dev/hda10 then you must keyin

# dd if=/dev/hda2 bs-512 count=1 of=/mnt/floppy/bootsect.lin

5)
bootsect.lin is the file name that you wanted to create in the floppy disk and you can use anyname you like. in this case i used bootsect.lin as my file name and i will use this name throught out this tutorial.

6) The command above is copying the 1st sector of /boot partition and turn it into a file which then you store it in a floppy disk. (NOTE: you can copy it into floppy disk or any other location where windows can access it)

7) Restart you Operating System into Windows.

8) copy the file bootsect.lin from the floppy disk to you C:
9)
Then click Start\run and keyin this line c:\boot.ini

10)
Add thisline c:\bootsect.lin=”My Linux ” in boot.ini
THIS IS HOW IT WILL LOOK LIKE IN BOOT.INI AFTER ADDING IT

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS=”Microsoft Windows XP Professional” /fastdetect
c:\bootsect.lin=”My Linux”
(This example that i use is Windows XP, if you use other versions of windows,it might be a little bit different)

11) After that save the file and you can now boot into Linux using
NT Bootloader.

12) You can now do anything you like to Linux and still be able to boot
in Windows like normal.





Bastille - Securing Linux

Bastille is a Program that helps you Harden/Secure your Linux Systems
by way of GUI or Console Based Questionaire.

Download Bastille Linux

http://internap.dl.sourceforge.net/sourceforge/bastille-linux/
Bastille-3.0.8-1.0.noarch.rpm

Installing Bastille Linux

[root@mybox Desktop]# rpm -ivh Bastille-3.0.8-1.0.noarch.rpm
Preparing... ########################################### [100%]
1:Bastille ########################################### [100%]

Please make sure perl-Tk and perl-Curses are installed.

I had the Following installed :

perl-Tk-804.027-4mdk

I did not have perl-Curses, So I had to install as below

[root@mybox Documents]# urpmi perl-Curses

ftp://gd.tuwien.ac.at/pub/linux/Mandriva/official/
2006.0/i586/media/main/perl-Curses-1.07-1mdk.i586.rpm

installing perl-Curses-1.07-1mdk.i586.rpm from /var/cache/urpmi/rpms
Preparing... #############################################
1/1: perl-Curses #############################################


Now Running the Bastille Commands :

bastille -x     (for Graphical Mode Hardening)
bastille -c (for Text Mode Hardening)
bastille --report (for Assesment and Reporting)

For complete list of options use bastille -h

For eg. the below command generates report

[root@mybox Documents]# bastille --assess

___-----____-----_____------_____--------
Bastille Hardening Assessment Completed

You can find a report in HTML format at:

/var/log/Bastille/Assessment/assessment-report.html

You can find a report in text format at:

/var/log/Bastille/Assessment/assessment-report.txt

You can find a more machine-parseable report at:

/var/log/Bastille/Assessment/assessment-log.txt

___-----____-----_____------_____-------____-----