Sunday, August 16, 2009

Recovering root password - Single User Mode

This post doesn't have a heading that suits well but this is the best way to let many understand something. Hey.. have you lost your root password and wonder you can't be root again? No way!!! Everything is possible. During system boot, select the linux operating system and edit by pressing e. Select the kernel inside of which you want to be root and edit the second line. Append a 1 or 's' or 'single' to the end of the line (instead of e for edit, you may use a for append). This way you switches to run level 1 ( root user) and next time onwards the kernel is loaded with run level 1. Details on run levels can be found in the file /etc/inittab.
Once booted as root you can easily change the root password by using the command "passwd" and later switch to other run levels. This technique can also be used in situations where a system will not boot normally, due to the state of the filesystem, the absence of startup files, or incorrect configuration.

Well..does this seem some sort of a loop hole and really big a flaw? It is not.. Set a grub password and you'll need to enter it for editing grub options and so also to change the access level.. Easiest of ways but involves yet another password. If you're not convinced that another password cannot solve the issue, there are more ways, i'll call them scrapy.. Lets discuss those later.. For the time being, please play with the root. But for god's sake , please don't be social engineers :)

No comments:

Post a Comment