Monday, November 22, 2010

How do I change the root password in Linux?

I have an old Linux PC but I forgot the root password.



How do I reset the password?



I tried to go to the root directory. However, when I typed ';su';, it prompted me for the root password. Since I have forgotten it, I cannot type it in and I, therefore, cannot go to the root directory to change the password.How do I change the root password in Linux?
Boot into the system at the physical console. Go into single user mode (check the documentation for your distro).



Make your way to the command prompt. Again consult the specifics for your distro.



Once there you should be able to run ';passwd root'; or similar to reset the password.



The physical console it ultimate power.



NOTE:



Some distros do not have a root account per se (Ubuntu comes to mind). Regular accounts are put in a super user list that are allowed to ';su'; or ';sudo';. In this case the password in question is the password of the account you are already logged in to. If you are allowed to ';go super'; you will temporarily assume ';root'; powers.How do I change the root password in Linux?
At the bootloader, boot into single user mode. You may have to pass init=/bin/bash as well as single in order to bypass the password.



At the prompt:



passwd
you need to log in as root to change the root password, there's no way around it.

If there were every cracker in the world would have a field day.



Your only option is to reinstall the operating system from scratch.
System, Administrator, Users and groups. Click root, then activate, then click root again, click preferences, and change the password.

No comments:

Post a Comment