Showing posts with label switch to single user mode. Show all posts
Showing posts with label switch to single user mode. Show all posts

Monday, December 3

Lost the Root password


Lost the Root password
When you lost root password how you can recover and login back in to the system?
To login in to system there are so many ways to get root access depending on security level of the system.
Method1: When there is no password set to access runlevel 1.
Here are the steps to change your root password the most esiest way is as follows..
1. Start your computer when you see Redhat Linux boot loader(GRUB menu where you can see all the Operating system’s in the system) select the redhat linux and press “e”, and select second line where you can set the temporary runlevel for the system to boot
2. You will notice that now you can edit boot loader command arguments now again press “e” and edit the line to add single or 1 without quots at the end of line.
3. Press enter to return to previous screen
4. Press b to boot with this new argument which will run Linux into single user mode. Please make sure that you see single at the end of line.
5. Now you will get root login with out asking for a password in single user mode.
6. Use “passwd” command to change your password.
#passwd
here it will not ask previous password so you can just enter new password.
7. When updateing the password in runlevel1 if the server is not allowing you to change password giving you error, this is due to /etc/shadow file issue.
In order to resolve this issue execute the following command and then try to change the password
#pwunconv
7.After changing the password just type exit command which will take you to default runlevel of the system or just Reboot and use the new password.