2. Entering Single User ModeEntering Single User Mode
●
After boot:After boot:
– init 1init 1
●
At GRUB (holdingAt GRUB (holding shiftshift key if no menu):key if no menu):
1. Press1. Press spacespace to stop timing outto stop timing out
2. Press2. Press ee to enter itemto enter item
3. Select the3. Select the kernelkernel lineline
4. Press4. Press ee againagain
5. Enter5. Enter EndEnd,, spacespace thenthen SS
6. Press6. Press Enter Enter
7. Press7. Press b b
3. Securing Single User ModeSecuring Single User Mode
●
Login as root:Login as root:
●
EditEdit /etc/inittab/etc/inittab
~~:S:respawn:/sbin/sulogin~~:S:respawn:/sbin/sulogin
●
Reboot, repeat previous exerciseReboot, repeat previous exercise
4. By Passing Single User ModeBy Passing Single User Mode
●
At GRUB (holdingAt GRUB (holding shiftshift key if no menu):key if no menu):
1. Press1. Press spacespace to stop timerto stop timer
2. Press2. Press ee to edit itemto edit item
3. Select the3. Select the kernelkernel lineline
4. Press4. Press ee againagain
5. Press5. Press EndEnd,, spacespace then enterthen enter init=/bin/bashinit=/bin/bash
6. Press6. Press Enter Enter
7. Press7. Press b b
8. Get a root shell without login, type8. Get a root shell without login, type idid commandcommand
9. Run9. Run mount o remount,rw,sync /mount o remount,rw,sync / to remount filesystemto remount filesystem
10. Edit10. Edit /etc/inittab/etc/inittab to remove the line added previouslyto remove the line added previously
5. Preventing Loader EditingPreventing Loader Editing
●
Login as root:Login as root:
●
EditEdit /boot/grub/menu.lst/boot/grub/menu.lst
●
Add this line in global section:Add this line in global section:
ppassword MY_PASSWORDassword MY_PASSWORD
●
Then reboot to try single user modeThen reboot to try single user mode
6. Rescue System Using CDRescue System Using CD
●
Reboot and select CD Boot from BIOS:Reboot and select CD Boot from BIOS:
1. Enter1. Enter linux rescue linux rescue at promptat prompt
2. Answer all the questions (Keep pressing Enter)2. Answer all the questions (Keep pressing Enter)
3. Finally you will have a root shell3. Finally you will have a root shell
4. Enter4. Enter chroot /mnt/sysimagechroot /mnt/sysimage to change to realto change to real
systemsystem
5. Enter5. Enter mount amount a to complete all mountingto complete all mounting
6. Edit6. Edit /boot/grub/menu.lst/boot/grub/menu.lst and remove theand remove the
password linepassword line
7. Reboot7. Reboot
7. Think AboutThink About
●
How to prevent system from bootingHow to prevent system from booting
from devices other than hard disk?from devices other than hard disk?
●
And how to secure it?And how to secure it?