Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
recovering root password
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
rdavl
n00b
n00b


Joined: 25 Jan 2006
Posts: 52

PostPosted: Thu Feb 23, 2006 1:27 am    Post subject: recovering root password Reply with quote

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
View user's profile Send private message
papal_authority
Veteran
Veteran


Joined: 31 Mar 2004
Posts: 1823
Location: Canada

PostPosted: Thu Feb 23, 2006 1:34 am    Post subject: Reply with quote

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
View user's profile Send private message
Headrush
Watchman
Watchman


Joined: 06 Nov 2003
Posts: 5597
Location: Bizarro World

PostPosted: Thu Feb 23, 2006 1:35 am    Post subject: Reply with quote

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
View user's profile Send private message
yther
Apprentice
Apprentice


Joined: 25 Oct 2002
Posts: 151
Location: Charlotte, NC (USA)

PostPosted: Thu Feb 23, 2006 2:48 am    Post subject: Reply with quote

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
View user's profile Send private message
avieth
Veteran
Veteran


Joined: 17 Sep 2004
Posts: 1945
Location: Canada

PostPosted: Thu Feb 23, 2006 3:16 am    Post subject: Reply with quote

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
View user's profile Send private message
hnat
n00b
n00b


Joined: 23 Feb 2006
Posts: 3

PostPosted: Thu Feb 23, 2006 7:15 am    Post subject: Recovering root password Reply with quote

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
View user's profile Send private message
ecatmur
Advocate
Advocate


Joined: 20 Oct 2003
Posts: 3595
Location: Edinburgh

PostPosted: Thu Feb 23, 2006 1:55 pm    Post subject: Reply with quote

Does your root password include punctuation characters? The livecd might be in the wrong keymap and you wouldn't notice.
_________________
No more cruft
dep: Revdeps that work
Using command-line ACCEPT_KEYWORDS?
Back to top
View user's profile Send private message
rdavl
n00b
n00b


Joined: 25 Jan 2006
Posts: 52

PostPosted: Thu Feb 23, 2006 3:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
hnat
n00b
n00b


Joined: 23 Feb 2006
Posts: 3

PostPosted: Thu Feb 23, 2006 3:12 pm    Post subject: recovering root password Reply with quote

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
View user's profile Send private message
papal_authority
Veteran
Veteran


Joined: 31 Mar 2004
Posts: 1823
Location: Canada

PostPosted: Thu Feb 23, 2006 3:39 pm    Post subject: Re: recovering root password Reply with quote

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
View user's profile Send private message
hnat
n00b
n00b


Joined: 23 Feb 2006
Posts: 3

PostPosted: Fri Feb 24, 2006 5:27 am    Post subject: recovering root password Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum