7
Chapter 16 Chapter 16 System Rescue System Rescue Ref. Pge. 194

Linux fundamental - Chap 16 System Rescue

Embed Size (px)

Citation preview

Page 1: Linux fundamental - Chap 16 System Rescue

Chapter 16Chapter 16System RescueSystem Rescue

Ref. Pge. 194

Page 2: Linux fundamental - Chap 16 System Rescue

Entering Single User ModeEntering Single User Mode● After boot:After boot:

– init 1init 1

● At GRUB (holding At GRUB (holding shiftshift key if no menu): key if no menu):1. Press 1. Press spacespace to stop timing out to stop timing out

2. Press 2. Press ee to enter item to enter item

3. Select the 3. Select the kernelkernel line line

4. Press 4. Press ee again again

5. Enter 5. Enter EndEnd, , spacespace then then SS

6. Press6. Press Enter Enter

7. Press7. Press b b

Page 3: Linux fundamental - Chap 16 System Rescue

Securing Single User ModeSecuring Single User Mode

● Login as root:Login as root:● Edit Edit /etc/inittab/etc/inittab

~~:S:respawn:/sbin/sulogin~~:S:respawn:/sbin/sulogin

● Reboot, repeat previous exerciseReboot, repeat previous exercise

Page 4: Linux fundamental - Chap 16 System Rescue

By Passing Single User ModeBy Passing Single User Mode● At GRUB (holding At GRUB (holding shiftshift key if no menu): key if no menu):

1. Press 1. Press spacespace to stop timer to stop timer

2. Press 2. Press ee to edit item to edit item

3. Select the 3. Select the kernelkernel line line

4. Press 4. Press ee again again

5. Press 5. Press EndEnd, , spacespace then enter then enter init=/bin/bashinit=/bin/bash

6. Press6. Press Enter Enter

7. Press7. Press b b

8. Get a root shell without login, type 8. Get a root shell without login, type idid command command

9. Run 9. Run mount ­o remount,rw,sync /mount ­o remount,rw,sync / to remount filesystem to remount filesystem

10. Edit 10. Edit /etc/inittab/etc/inittab to remove the line added previously to remove the line added previously

Page 5: Linux fundamental - Chap 16 System Rescue

Preventing Loader EditingPreventing Loader Editing

● Login as root:Login as root:● Edit Edit /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

Page 6: Linux fundamental - Chap 16 System Rescue

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 prompt at 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. Enter 4. Enter chroot /mnt/sysimagechroot /mnt/sysimage to change to real to change to real systemsystem

5. Enter 5. Enter mount ­amount ­a to complete all mounting to complete all mounting

6. Edit 6. Edit /boot/grub/menu.lst/boot/grub/menu.lst and remove the and remove the password linepassword line

7. Reboot 7. Reboot

Page 7: Linux fundamental - Chap 16 System Rescue

Think AboutThink About

● How to prevent system from booting How 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?