Flipkart.com

Tuesday 1 May 2012

How To Reset Linux Password

Resetting your systems root password may be a necessary step if you have forgotten it.
Let’s look at some ways you can use to reset your Linux system’s password. You might know that the root user can change the password for any other user. However what if you forget your root password ?

So, how to reset password in Linux.

To reset your root password (or any other account’s password), there are two different situations which require varying approaches.


1. When you can use GRUB
-------------------------------

If you have GRUB installed and you have an accesses to edit boot parameters of selected entries then the job is to easy. Let see how you can have root access in no time. Once you have root access you can do what ever you want to do with the system!

Follow the steps given below to gain access:

  • Choose the GRUB entry for the Linux installation that you want to reset the password.

  • Press " e " on keyboard to edit it.

  • Select the Kernel line. Add " singleat the end of the kernel line.
  • Press " b " to boot (F10 also works). Some system system still requires you to enter the root password. 




For those system asking password still Perform these steps.
  • Choose the GRUB entry for the Linux installation that you want to reset the password.
  • Press " e " on keyboard to edit it.
  • Select the Kernel line.
  • add " init=/bin/bashat the end. Press  " b " to boot (F10 also works).
  • Either you would be taken to the root prompt directly or shown the recovery menu from where you can choose the root prompt.
  • Use " passwd " to change the password for any account.
  • Type " reboot " to reboot the system and then log in in with your new password.

  • Note: Some distributions will create a recovery mode entry during install. If you have the recovery mode entry listed in GRUB, you need not do any of the above, just choose the recovery mode and then choose root prompt at the screen that follows.
  • 2. When you can’t use GRUB
  • ---------------------------------
If your GRUB does not give you privileges to edit the parameters. In this case let see how you can get root access.
For this you need to have a Live CD of Linux to reset the password (I will be using Ubuntu Live CD, you can use any other).
Follow the steps given below to gain access:
  • Boot from the Live CD
  • Choose “ Try Ubuntu without any changes to your computer ”.
  • When the system is ready, Open a terminal window.
  • Type " sudo fdisk -l ".
  • In the output we are concerned to know which partition Linux is installed on and what name the hard disk is using. (e.g) in this case it is /dev/sda1 is the required partition. If you are sure about the partition you can skip this step.
  • Next we need to mount the Linux partition. Do it you self. I think you can do it. if not then run the command in the next line given here.
  • Mount the linux partition using the command " sudo mount /dev/sda1 /media/linx_part ".
  • Change Root to the mount directory – " sudo chroot /media/sda1 ".
  • Type passwd hit enter and then enter the new password.
  • Type reboot to restart the system.

If you like the post please do suscribe us and like us on Facebook, also follow us on twitter

0 comments:

Post a Comment

IHT