ComputerSecurityStudent (CSS) [Login] [Join Now]




|UNIX >> Ubuntu >> Ubuntu 12.04 Desktop >> Current Page |Views: 39450

(Ubuntu: Lesson 2)

{ Use Ubuntu 12.04 Grub to boot into single user mode }


Section 0. Background Information
  1. Background information.
    • Lets say you lost the root password and you have no way to figure it out.  No problem.  All you simply have to do is to physically power off the machine and power it back on.  During the start of the reboot, hit the "shift" key.  If you are using VMware, you will need to click in the Black VMware window before reboot and then press the "shift" key.

  2. Prerequisite
  3. Lab Notes
    • In this lab we will do the following:
      1. We will access the Grub menu during the boot process.
      2. We will edit the Grub menu to boot into single user mode.
      3. We will change the root password.

  4. Legal Disclaimer
    • As a condition of your use of this Web site, you warrant to computersecuritystudent.com that you will not use this Web site for any purpose that is unlawful or that is prohibited by these terms, conditions, and notices.
    • In accordance with UCC § 2-316, this product is provided with "no warranties, either express or implied." The information contained is provided "as-is", with "no guarantee of merchantability."
    • In addition, this is a teaching website that does not condone malicious behavior of any kind.
    • You are on notice, that continuing and/or using this lab outside your "own" test environment is considered malicious and is against the law.
    • © 2012 No content replication of any kind is allowed without express written permission.

Section 1: Start Ubuntu 12.04
  1. Start Ubuntu 12.04
    • Instructions
      1. For Windows 7
        • Start --> All Programs --> VMware Player
      2. For Windows XP
        • Starts --> Programs --> VMware Player

     

  2. Verify Virtual Machine Settings.
    • Instructions
      1. Click on Ubuntu 12.04
      2. Click on Edit virtual machine settings

     

  3. Set CD/DVD(IDE)
    • Instructions
      1. Click on CD/DVD(IDE)
      2. Select radio button: Use physical drive
      3. Select Auto detect from the drop down list.
      4. DO NOT CLICK THE OKAY BUTTON YET.

     

  4. Set Network Adapter
    • Instructions
      1. Click on Network Adapter
      2. Select radio button: Bridged
      3. Now, Click the OK Button.

     

  5. Start the Ubuntu 12.04 VM
    • Instructions
      1. Click on Ubuntu 12.04
      2. Click on Play virtual machine

     

Section 2: Boot to Grub 2 Menu
  1. Boot to Grub 2 Menu
    • Instructions
      1. Once you see the below vmware screen, (1) Left Click in the screen and (2) press the <Shift> key.

     

  2. The Grub 2 Menu
    • Informational
      1. Below is the Grub 2 menu.
      2. Continue to Next Section.

     

Section 3: Use Grub to Boot into Single User Mode
  1. Edit the Grub Menu
    • Instructions
      1. Make sure Ubuntu, with Linux 3.2.0-23-generic-pae is highlighted.
      2. Press "e".

     

  2. Cursor Placement
    • Instructions
      1. Cursor down to the line that starts with "linux /boot/vmlinuz-3.2.0-23-generice-pae".
      2. Cursor right until your cursor is positioned directly after $vt_handoff.
      3. Continue to next step.

     

  3. Delete "o  quite splash $vt_handoff"
    • Instructions
      1. Use the backspace key to delete the following characters:
        • "o  quiet splash $vt_handoff"
      2. Continue to next step.

     

  4. Add the string "w init=/bin/bash"
    • Instructions
      1. Type the follow string after the "r".
        • w init=/bin/bash
      2. Press <Ctrl> and "x" to boot to single mode.

     

  5. Welcome to root
    • Note(FYI):
      1. You are now the root user
      2. Continue to next section.

     

Section 4: Reset the root password
  1. Reset root's password
    • Instructions
      1. passwd root
      2. Supply the password of your choice.

     

  2. Sync and Reboot
    • Instructions
      1. sync
      2. reboot -f

     

  3. Edit the Grub Menu
    • Instructions
      1. Make sure Ubuntu, with Linux 3.2.0-23-generic-pae is highlighted.
      2. Press "e".

     

  4. Boot Machine
    • Instructions
      1. Press <Ctrl> and "x" to boot the machine.

     

  5. Login to Server
    • Instructions
      1. User: Student
      2. Password: Please supply the student password.

     

  6. Start up a Terminal
    • Instructions
      1. Click on the Terminal

     

  7. Test the new root password
    • Instructions
      1. su - root
      2. Enter your new root password that you created in
        • (Section 4, Step 2)

 

Section 5: Proof of Lab
 
  1. Proof of Lab
    • Instructions
      1. chage -l root | grep "password change"
      2. date
      3. echo "Your Name"
        • Replace the string "Your Name" with your actual name.
        • e.g., echo "John Gray"
    • Proof of Lab Instructions
      1. Press both the <Ctrl> and <Alt> keys at the same time.
      2. Do a <PrtScn>
      3. Paste into a word document
      4. Upload to Moodle

     



Help ComputerSecurityStudent
pay for continued research,
resources & bandwidth