Contact us

Print

llm1-appendix5

Exercise 1

Almost every computer user, has forgotten a password at one time or the other. We are living in an age where we are required to use passwords for various functions - e-mail accounts, Banking functions, Home security systems, computer access tokens etc.
In a bid to use increasingly more secure/complex passwords, people sometimes mix up/forget passwords and end up locking themselves out of their systems. The famous password mantra is:

“To forget one’s password is human, but to be able to reset it is divine”

This exercise demonstrates how to use the Linux boot loader - Grub, to reset the most important password on a Linux based system - the root password.

To reset the root password through Grub


1. While logged in as the super-user, reboot the system.

2. After the system runs its POST BIOS tests etc. .. you will see a screen similar to the one below.
Quickly press any key on your keyboard to stop Grub’s timer from counting down and booting your
default kernel.





Study the text on the screen to enable you become familiar with Grub’s navigation menu.





3. Press the letter “a” on your keyboard to modify the kernel arguments.
When the screen below appears, press the SPACE key and type the letter “s” at the end of the line.




4. Now press ENTER on your keyboard to boot the kernel whose arguments you just modified.

5. The system should boot very quickly and drop you straight into single user mode. You will get a
command shell like the one below.

sh-2.05b# _

6. Use the “whoami” command to find out whom you are logged in as?


7. As you can see, you are logged in as root with “unlimited” powers.

8. Use the “passwd” command to reset, root’s password. Type:

sh-2.05b# passwd

Changing password for user root.
New UNIX password: **************

(Retype the same password when prompted again)

9. That’s it. You are done resetting the super-user password.

10. If you were a malicious user, you can issue this command “ rm –rf / “

YOU ARE NOT A MALICIOUS USER …. so ….. DON’T try that command.
If you have already tried the command you will have to re-install your system 

11. Reboot the system when you are done or simply type “exit” at the shell, to make system continue to
boot into your usual default run-level - 3 or 5.



NOTE:

Observe very carefully, that at no point in the short exercise above, were you prompted for root’s password in order to get a command shell!!

Hopefully you got the point of this exercise.


Created by: system. Last Modification: Saturday 02 of May, 2009 15:15:41 EST by wale.

...