Complete.Org: Mailing Lists: Archives: linux-help: October 2000:
[linux-help] Re: Recover root password when using shadow passwords
Home

[linux-help] Re: Recover root password when using shadow passwords

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: linux-help@xxxxxxxxx
Subject: [linux-help] Re: Recover root password when using shadow passwords
From: Tom Hull <thull@xxxxxxxxxxx>
Date: Tue, 24 Oct 2000 11:46:15 -0500
Reply-to: linux-help@xxxxxxxxx

Al Licause wrote:
> 
> Hello,
> 
> I recently did a very stupid thing on my v2.2.16 redhat Linux system.
> 
> In an attempt to figure out or implement NIS, I removed the shadow
> password files and now cannot access the root account.
> 
> I've tried the trick of booting into single user mode and changing the
> root password, but since the system is configured to use shadow
> passwords, as soon as I go to run state 3, the password change
> is ignored.
> 
> Would you be able to tell me how to recover from this most unfortunate
> screw up ?

You might try handcrafting a new /etc/shadow file. Something like this
might do:

  root::10910:0:99999:7:::

(The 10910 isn't magic; just a date in the past.) More comprehensively:

  sed 's/:.*/:*:10910:0:99999:7:::/' /etc/passwd >/etc/shadow

Then try using passwd to change (or delete, use passwd -d) passwords.

I don't know how to enable/disable shadow passwords. There is a program
on some distributions called shadowconfig(8) -- the source of that might
help you.

I've managed to avoid using NIS all my life. The last time I knew anything
about it was before shadow passwords came into being, but I'd guess that
you do want to keep /etc/shadow for your local passwords (like root), and
merely remove any entries from /etc/shadow for passwords that you plan to
store in NIS. In /etc/passwd you mark the point to start searching NIS
with a +. I doubt that you have to do that in /etc/shadow, but then you
never really know about programs -- unless you read the source.

> Al Licause

-- 
/*
 *  Tom Hull * thull@xxxxxxxxxxx * http://www.ocston.org/~thull/
 */

-- This is the linux-help@xxxxxxxxx list.  To unsubscribe,
visit http://tmp2.complete.org/cgi-bin/listargate-aclug.cgi


[Prev in Thread] Current Thread [Next in Thread]