How To Password Protect Your Linux Box (OS) With GRUB
To get started, let's first encrypt the password we want to use. Open up a terminal and enter the grub command. This brings up a grub shell. In this shell, enter the md5crypt command. When prompted, type in the password you want on your grub entries. (Don't worry, this won't write anything to your files!) After pressing Enter, you will be given an encrypted password string. Copy the string to your clipboard. Enter quit to exit the grub shell and return to bash.
GNU GRUB version 0.95 (640K lower / 3072K upper memory) [ Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists the possible completions of a device/filename. ] grub> md5crypt Password: ************* Encrypted: $1$w7Epf0$vX6rxpozznLAVxZGkcFcs. grub>
After the "initrd" line for each entry you want to password protect, start a new line beginning with password --md5 and paste in your newly-encrypted password. Using the above example password on the i386 recovery entry, this:
title Ubuntu, kernel 2.6.8.1-2-386 (recovery mode)
root (hd1,2)
kernel /boot/vmlinuz-2.6.8.1-2-386 root=/dev/hdb3 ro single
initrd /boot/initrd.img-2.6.8.1-2-386Becomes this:
title Ubuntu, kernel 2.6.8.1-2-386 (recovery mode)
root (hd1,2)
kernel /boot/vmlinuz-2.6.8.1-2-386 root=/dev/hdb3 ro single
initrd /boot/initrd.img-2.6.8.1-2-386
password --md5 $1$w7Epf0$vX6rxpozznLAVxZGkcFcs.Save the file, and reboot. (The first time you try this, I suggest only doing it to one entry so you can test it to make sure it works, and you can still use another entry to boot your machine in case something went wrong.)
For a bit of added peace of mind, you can prevent everyone except root from reading /boot/grub/menu.lst by doing:
sudo chmod 600 /boot/grub/menu.lst
Thats it u r finished with it.
Hopes u enjoy this., have fun. Enjoy Hacking.. Enjoy Hackton
8:14 PM by Shubham Mittal · 0
Speedup Operating System Installation And Maintainance
Save yourself time by making Windows installation files available on your hard drive.
We know you've had this problem: you install a new mouse, change a network setting, do almost anything that upsets the delicate balance in Windows and you're prompted to insert the Windows so-and-so CD. Where is it? Did you grab the right one?
If you have a lot of free disk space (about 700 MB), take a cue from the major PC makers and copy the files from your Windows CD to your hard drive. In fact, it's not a bad idea to copy the files before you install Windows so the resulting installation automatically knows where to find the files later—thus no prompting to insert a CD later.
PC manufacturers have typically placed the Windows 95, 98, 98SE, and Me files in a C:\WINDOWS\OPTIONS\CABS folder, and Windows NT, 2000 or XP files into C:\i386.
You can emulate this pattern for Windows 9x-Me by creating these folders on your hard drive from a DOS prompt, then copying the files from the CD (assuming this is drive D:) as follows, from the A:\> DOS prompt:
A:\>C:
C:\>MD WINDOWS C:\>MD
\WINDOWS\OPTIONS C:\>MD
\WINDOWS\OPTIONS\CABS C:\>CD
\WINDOWS\OPTIONS\CABS C:\
\WINDOWS\OPTIONS\CABS>COPY
D:\WIN98\*.*
Start the Windows installation from this folder by typing:
C:\ \WINDOWS\OPTIONS\CABS>SETUP
For Windows NT-XP:
A:\>C: C:\>MD
i386 C:\>CD i386
C:\I386>COPY D:\i386\*.*
Start the Windows installation from this folder by running this command:
C:\I386>WINNT
The next time Windows needs a file from the installation CD it will automatically look in the appropriate folder, copy the file, and move on.
7:16 AM by Shubham Mittal · 0
Fix the Master Boot Record on FAT Partitions
Use FDISK to restore the ability to boot from your FAT-16 or FAT-32 hard drive.
FDISK is a DOS program that can actually help you out of some of those nasty "unable to locate operating system" and "no boot drive available" error conditions Windows 9x and DOS users encounter from time to time. The Master Boot Record can be corrupted by an improper shutdown, power glitch, or disk failure. Re-creating a new Master Boot Record at the first sector of the hard drive—which is what your system BIOS is looking for in order to turn over the startup operation to an operating system—is an easy fix.
|
To use FDISK's Master Boot Record restoration feature to get your main or additional drives back into bootable shape, follow these steps:
-
Boot with a DOS diskette, boot CD, or bootable USB FLASH drive or hard drive containing DOS and FDISK. A Windows 98 or Me startup diskette will do nicely.
-
At the command prompt type in either:
FDISK /MBR
orFDISK /CMBR
x -
Remove the disk or device you booted to DOS with and then restart the system to verify that you can boot from the hard drive.
FDISK /MBR re-creates the Master Boot Record, the first sector of the hard disk. This can be helpful to repair a damaged or corrupted bootable drive.
FDISK /CMBR x re-creates the boot sector of the first (x = 1), second (x = 2), third (x = 3), or fourth (x = 4) hard disk(s).
5:25 AM by Shubham Mittal · 0