[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: problem with corrupted root password



On 15/01/2015 01:00, Gary Dale wrote:
On 14/01/15 04:26 PM, Rob Owens wrote:
On Wed, Jan 14, 2015 at 03:07:09PM -0500, Comer Duncan wrote:
I recently got wheezy up and running.  I installed xfce4 and like it.

However, today in the process of trying to spawn a root terminal (in
Accessories) and going through a cycle of trying to get authorized but
being prevented by repeated complaints that the system password I
used was
not correct, I now find that I can not get logged in in single-user
mode!
I have thus royally screwed up.  So, how can I get the system password
changed to something new?

Thanks for help and apologies for making such an error.
Boot using a Live CD, then as root:

mount /dev/sda1 /mnt/sda1 (or whatever device is your root partition)
chroot /mnt/sda1
passwd
I'd change the chroot command to
   chroot /mnt/sda1 bash

to ensure you get the correct shell. System Rescue CD, for example, uses
zsh by default so chrooting with specifying the shell will get you a
not-found error.



Wouldn't it work too if you delete the root line in /etc/shadow ?
When I say delete, I mean just the hash, you would leave a line:

root:

And just for fun (well maybe I'll try this later) if you take your user hash in the same file and copy it in the place of the root hash, wouldn't root get the same password as the user one?

All this from a boot cd of course!

--
mrr


Reply to: