Skip to main content

Linux Root Password Recovery

"root"  is the super user of Linux Operating System and he has full privilege to do anything on it. and if you forgot the root users password then it is very helpless situation for you. in this situation you will not able to do any changes in Linux Operating system, and as a standard user you do not have such privilege who has root user. but do not vary about this problem, Linux operating system has solution for this problem.

Before do this you need some basic concept  about "init" process.  init is father of all Linux processes and it is first process which is executed at the time of booting after the loading Linux kernel in to the RAM. By default init has 7 run levels and every run level has specific use.

Default runlevel. The runlevels used by Linux are:
#   0 - halt (Do NOT set initdefault to this)
#   1 - Single user mode
#   2 - Multiuser, without NFS (The same as 3, if you do not have networking)
#   3 - Full multiuser mode
#   4 - unused
#   5 - X11
#   6 - reboot (Do NOT set initdefault to this)

This run levels you can change by 3 different ways in Linux Operating System

  1. In first method you can change run level from init configuration (/etc/inittab) file it will be permanent,
  2. In Second method run levels can change  from Linux command prompt,
  3. You can also change run level temporary at the booting time.

For recover root password you will use third method change run level while booting. Step by step procedure describe below

Step - 1. Boot you which root Linux and grub boot loader screen will appear press "Enter" key and you will be in following screen, and hear type "e" to go in to edit mode.

image

Step - 2. In the edit windows select line which start from "kernel" and again press "e" to edit this line.

image

Step - 3. Now you are in Line editing mode and curser will be at end of the kernel line, at the end of line first press "space bar" and then type "1" and press "Enter" and then press "b" to boot the Linux with the new setting. and boot will start.

image

Step - 4. Wow see what happed you are in shall prompt without username and password, this is magic of Single user mode in Single user mode Linux never ask for username password to enter in to Linux system.

image 

Step -5. Now at shall prompt type "passwd" command to change root password and for change password system will not ask for previous password, hear type new password and retype same password and you root password is changed reboot you Linux and login as a root with the new password and enjoy it.

image

Warning - In our world every thing has good side as well as bad side also. Linux Signal user mode also has bad side if anybody has physical accesses on you system so he can use single user mode to change root password, so you need to secure you systems single user mode for this two sequence of methods

  1. Protect your system with Bios Password.
  2. And use grub password to protect the grub editing mode while booting

_______________________________________________________________

Comments

  1. For the recovery of root password this is one of the most efficient product . I have used Stellar phoenix Linux Recovery Software to recover my lost files .

    ReplyDelete
  2. Thanks Wattson111 to sharing information, above Method in article is inbuilt feature of Linux it is Linux Single User, without any software you can change root password

    ReplyDelete

Post a Comment

Popular posts from this blog

SharePoint WebPart Error - Unable to add selected web part (s) – MOSS 2007

ISSUE: Recently I faced this issue that when I try to deploy my WebPart.  Unable to add selected web part(s). WebPartName: Cannon unregister UpdatePanel with ID ‘ctl00RTMPanel’ since it was not registerd with the ScripManager. This might occure if the UpdatePanel was removed from the control tree and later added again, which is not supported. Parameter name: updatePanel.   I faced this issue twice and both the time the issue was not what display here. This could be sure to any error in the WebPart. Following are list resolution from multiple instances.   RESOLUTION: 1. Check the WebPartName.webpart file. Check whether you have a proper PublicKeyToken value. When I face the issue the value was PublicKeyToken=$PublicKeyToken$. If you have used WSP builder then in the Visual Studio you will find this file at \WebPartsProject\12\TEMPLATE\FEATURES\WebPartName\WebPartName.webpart. Sometime when you create a new WebPart using WSP builder then you do not get

How To Create Virtual Machine Using Existing vmdk file in VMWare Workstation

vmdk file is hard disk of the VMWare virtual machine. There are many scenarios where you may need to create a new virtual machine for an existing vmdk file. This is also an alternate Method to the “ vmx is not a valid virtual machine configuration file – Could not open virtual machine ” issue. Please refer to the previous post “ Could not open virtual machine – vmx is not a valid virtual machine configuration file ” for a full list of possible resolution. This post is to describe one of the solution in more details. How To Create a new virtual machine & attach the existing .vmdk file: 1. Open VMware and select create a new virtual machine with custom (advanced) configuration option. 2. Chose “I will install the operating system later”. and chose “I will install the operating system later”. 3. Select the operating system that matches the operating system in your existing .vldk file. 4. Select a location of the new virtual machine 5. Chose “Use an exis

Could not open virtual machine – vmx is not a valid virtual machine configuration file

I recently faced an issue with one of my VMWare virtual machine that when I try to run this virtual machine it did not work. VMWare display this message that “Could not open virtual machine: .vmx. ".vmx" is not a valid virtual machine configuration file.” ISSUE: Could not open virtual machine: G:\VPC\RakhiQAXPProfQtp\Windows XP Professional.vmx. "G:\VPC\RakhiQAXPProfQtp\Windows XP Professional.vmx" is not a valid virtual machine configuration file. I try to open .vmx file [G:\VPC\RakhiQAXPProfQtp\Windows XP Professional.vmx] in notepad then I found it was empty (0 KB). Resolution: I wanted to resolve it quickly so I try following method and it worked very well. But this is not a valid documented process so please try with caution. Following are the steps 1. First of all go to the folder where you have your virtual machine and delete all .lck folders. 564df2d4-03de-04e8-d1c3-bd2d53dcb1b7.vmem.lck Windows XP Professional.vmdk.lck