View previous topic :: View next topic |
Author |
Message |
rdavl n00b
Joined: 25 Jan 2006 Posts: 52
|
Posted: Thu Feb 23, 2006 1:27 am Post subject: recovering root password |
|
|
So a guy changes a root password and then forgets it.... is it possible to boot from live cd mount /etc partition and copy /etc/shadow- over /etc/shadow to recover old password? _________________ "Meow" means "woof" in cat. |
|
Back to top |
|
|
papal_authority Veteran
Joined: 31 Mar 2004 Posts: 1823 Location: Canada
|
Posted: Thu Feb 23, 2006 1:34 am Post subject: |
|
|
Why don't you just edit /etc/shadow to have no password when booted from the CD and then boot up normally and change it? _________________ The free market gave me gonorrhea. |
|
Back to top |
|
|
Headrush Watchman
Joined: 06 Nov 2003 Posts: 5597 Location: Bizarro World
|
Posted: Thu Feb 23, 2006 1:35 am Post subject: |
|
|
Just start the LiveCD, mount the partition, chroot in and then CHANGE the passwd.
(If you forgot it anyways, why bother with recovering the old one, make a new one.) |
|
Back to top |
|
|
yther Apprentice
Joined: 25 Oct 2002 Posts: 151 Location: Charlotte, NC (USA)
|
Posted: Thu Feb 23, 2006 2:48 am Post subject: |
|
|
Both of those suggestions are good ones! I've used the first one; it's simple and effective. (Consult the man pages for passwd and shadow, and it should be pretty easy figuring out which field to zap.) When I had to do it, I edited /etc/passwd also, just to be safe; I don't know if it was absolutely necessary.
The second solution, however, is more elegant. It's harder to remember (at least for me), but doesn't involve editing anything.
I love LiveCDs! Recently I have discovered that it's a good idea to keep a few around. You never know when you'll need one, and when you need one you really need one... |
|
Back to top |
|
|
avieth Veteran
Joined: 17 Sep 2004 Posts: 1945 Location: Canada
|
Posted: Thu Feb 23, 2006 3:16 am Post subject: |
|
|
Or, there is another. When grub comes up on boot, press e, and edit the kernel line, adding the word
single
to the end of the line
This will give you a root command line when your init scripts are done. You can then type passwd to cahange it. Quick and easy. |
|
Back to top |
|
|
hnat n00b
Joined: 23 Feb 2006 Posts: 3
|
Posted: Thu Feb 23, 2006 7:15 am Post subject: Recovering root password |
|
|
I have the same problem, my gentoo box isn't accepting my root password any more. I booted with the live CD mounted the disks and chrooted. After that i could set a new password. But when i do the normal boot and try to 'su root' the new password isn't accepted. I tried some things like changing the password manually (i copied my user password to the root user) and to delete the password totally but all that doesn't lead to success. What could i try else? What could be wrong?
Thanks in advance for any suggestions
r. hnat |
|
Back to top |
|
|
ecatmur Advocate
Joined: 20 Oct 2003 Posts: 3595 Location: Edinburgh
|
|
Back to top |
|
|
rdavl n00b
Joined: 25 Jan 2006 Posts: 52
|
Posted: Thu Feb 23, 2006 3:02 pm Post subject: |
|
|
Just a solution i did...
Boot from livecd, mount and chroot into disk instalation and did passwd... as Headrush have sugested...
It seems to be the easiest way to go around the problem... _________________ "Meow" means "woof" in cat. |
|
Back to top |
|
|
hnat n00b
Joined: 23 Feb 2006 Posts: 3
|
Posted: Thu Feb 23, 2006 3:12 pm Post subject: recovering root password |
|
|
The password I choose has no punctuation characters nor any accented characters. Furthermore I tried different keymaps when starting the Live CD. |
|
Back to top |
|
|
papal_authority Veteran
Joined: 31 Mar 2004 Posts: 1823 Location: Canada
|
Posted: Thu Feb 23, 2006 3:39 pm Post subject: Re: recovering root password |
|
|
hnat wrote: | The password I choose has no punctuation characters nor any accented characters. Furthermore I tried different keymaps when starting the Live CD. |
Why don't you just edit /etc/shadow while booted from the CD to have no password then? It's the second field. _________________ The free market gave me gonorrhea. |
|
Back to top |
|
|
hnat n00b
Joined: 23 Feb 2006 Posts: 3
|
Posted: Fri Feb 24, 2006 5:27 am Post subject: recovering root password |
|
|
Of course i have tried editing /etc/shadow manually. The problem is not to *set* a password. This works without a problem. But the password I set is not accepted. I am curious how the password check works. Which programs could be broken? What might be to repair? |
|
Back to top |
|
|
|