By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,761 Members | 1,018 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,761 IT Pros & Developers. It's quick & easy.

forgotten root password

P: 16
Hi friends,
I hv forgotten my password & unable log in on my system....
I hd tried by making system in SINGLE mode
PLZ tell me different ideas to enhance my knowledge
Oct 6 '07 #1
Share this Question
Share on Google+
4 Replies

WhiteRider
P: 37
The best method I know of is setting the boot loader (mine is Grub) to boot differently. On my machine this is F2 to add in parameters. What you mention is "single" although I haven't tried this. What I done was "init=/bin/bash"

Once you've added this it should boot up in a root terminal, here you can do the "passwd" command here. Simply set the new passwrod and reboot.

Good luck!

P.S please remember to create and USE another account other than root. This is very important as its easy to mess up your system under root and also if you get cracked the cracker will instantly have root privileges.
Oct 6 '07 #2

P: 11
Hi friends,
I hv forgotten my password & unable log in on my system....
I hd tried by making system in SINGLE mode
PLZ tell me different ideas to enhance my knowledge
The best way of doing it is the single mode (which you tried)
Please tell me what problem you faced while doing the same. It is pretty easy and I guess if you give me the exact ouput i might help.
Oct 8 '07 #3

prn
Expert 100+
P: 254
prn
You don't say what kind of system you are dealing with, but whether it is Linux or Solaris or whatever, the answer is basically similar.

The most effective way of dealing with a forgotten root password (and please do take White Rider's suggestion of not normally logging in as root) is to boot from a cd (live cd or installation cd) and then from a shell, you mount the HD / partition, navigate to /mnt/etc (or whereever you mounted it), back up your shadow file (just in case) with "cp shadow shadow.bak", then edit shadow, removing the characters between the first and second colons ( : ) so that the "root" line begins with

root::

DO NOT REMOVE ANYTHING ELSE!

Sorry to shout, but that's very important. You could seriously mess up your system. (Of course, that's why I told you to make a backup first).

Now you should be able to reboot, log in as root and set your password. Then don't forget it! After that, make sure to log in as a normal user most of the time and su to root only when you specifically need it.

HTH,
Paul
Oct 8 '07 #4

P: 53
Hi buddy,

You can just modify the kernel arguments by appending -s to the lines specified on the boot loader.This will give you the bash shell on single user mode.You can just use the passwd command to do the thing.

The above idea will work out if there is no authentication by boot loaders.If there is any password specification for boot loaders, You cannot modify the kernel arguments.Still now i didnt heard any ideas to modify them.Is there any way to solve this problem?
Oct 9 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.