Retreiving root password


Single user mode is one of the run levels provided by the Linux. In this run level after booting you are dropped into root shell. You need not have to specify the password. This runlevel is provided for the administrators to do the maintenance.


There are many ways to boot in single user mode. One of them will be passing kernel parameter using bootloader. Bootloader are used when you have more than one OS installed on the computer.Most of the linux boxes have Grub bootloader. If you are using Grub then to boot into Single user mode you have to follow these steps


  • Select Linux OS by arrow keys and press E to edit
  • Select the line containing similar to kernel /vmlinuz-2.4.22-1.2115.nptl ro root=LABEL=/ rhgb and press E to edit it.
  • Append single and press Enter
  • Press b to boot and enjoy


Things are almost same for other boot loaders like lilo.


But this thing can be used by others to get access of your machine. You can prevent otehrs booting into single user mode by setting password to grub. The user will not be able to edit the boot command unless he provides grub password. Follow the steps to set password to grub.


  • use md5crypt command to get the md5 crypted PASSWORD. For that type md5crypt on command line. It will ask for password which is to be encrypted.
  • Give the password to set. Confirm it. And copy the output which will be pated into grub'c configuration file which is normally /boot/grub/grub.conf .If you have changed this conf file, then rather you would never prefer to read this stupid tip :) .
  • Open file /boot/grub/grub.conf. Ofcourse only root can edit this file :) append line password --md5 PASSWORD where PASSWORD is output of md5vrypt command which you have copied earlier. And sit back and realx.


Is my comp safe now?


Probably not. Your friendd can use boot disk. How to create a boot disk for other linux box? Think. It's just changing one line in a particular file. Or he can simply use install cd and boot in rescue mode by simply typing linux rescue at boot prompt.


Now how to stop them. Simple change you CMOS setting. Don't let them use other drives to boot from unless they provide one more password.


But what if your smart friend managed to reset you CMOS setting by simply removing the batteries which powers your CMOS :) The solution is put a big lock on your CPU cabinet :)


Hosted by www.Geocities.ws

1