more help needed with changing root password

more help needed with changing root password

Post by richard noel fel » Wed, 28 Feb 2001 04:52:22



Sorry to be such a bother, but this is not going as smoothly as I had hoped.

I edited, via the rescue disk, the /etc/passwd file for my root entry to

root::0:root:/root:/bin/bash. Now, when I reboot, when I try to log in as root, I am prompted for a password. Of course

this is what I was trying to avoid in the first place. Is not my entry for root in etc/passwd correct to allow me

to log on without a password?

Thanks for any help,

Dick Fell

--
Please note new email address:

Richard Fell
13 Davida Road
Burlington, Ma 01803
(781)273-2126

 
 
 

more help needed with changing root password

Post by Lew Pitch » Wed, 28 Feb 2001 03:53:50




Quote:

>--------------176DA4184BD1239EA0E9F6AA
>Content-Type: text/plain; charset=us-ascii
>Content-Transfer-Encoding: 7bit

>Sorry to be such a bother, but this is not going as smoothly as I had hoped.

>I edited, via the rescue disk, the /etc/passwd file for my root entry to

>root::0:root:/root:/bin/bash. Now, when I reboot, when I try to log in as root, I am prompted for a password. Of course

 root::0:0:root:/root:/bin/bash

Quote:>this is what I was trying to avoid in the first place. Is not my entry for root in etc/passwd correct to allow me

>to log on without a password?

Do you use LILO? If so,
- reboot and hit the left alt key to get the LILO boot commandprompt
- hit the tab key to get a list of boots known to LILO
- locate the one that boots your Linux. It's likely called 'linux' but
  it may not be.
- enter the command 'linux single' to the command prompt
  (substitute the name of your linux boot for the word 'linux' above;
   eg. if your menu shows RedHat as the os, then 'RedHat single' is
   the command)
This should boot you into single-user mode, which (in most distros)
makes you root, and does not require the password.

Now, at the shell command prompt, run the password program (passwd) to
set the root password properly.

Finally, at the shell command prompt, 'init 5' or 'init 3' or whatever
to get into multiuser mode.

>Thanks for any help,

>Dick Fell

>--
>Please note new email address:

>Richard Fell
>13 Davida Road
>Burlington, Ma 01803
>(781)273-2126

>--------------176DA4184BD1239EA0E9F6AA
>Content-Type: text/html; charset=us-ascii
>Content-Transfer-Encoding: 7bit

><!doctype html public "-//w3c//dtd html 4.0 transitional//en">
><html>

><pre>Sorry to be such a bother, but this is not going as smoothly as I&nbsp;had hoped.</pre>

><pre>I edited, via the rescue disk, the /etc/passwd file for my root entry to</pre>

><pre>root::0:root:/root:/bin/bash. Now, when I&nbsp;reboot, when I&nbsp;try to log in as root, I am prompted for a password. Of course</pre>

><pre>this is what I&nbsp;was trying to avoid in the first place. Is not my entry for root in etc/passwd correct to allow me</pre>

><pre>to log on without a password?</pre>

><pre>Thanks for any help,</pre>

><pre>Dick Fell</pre>

><pre>--&nbsp;
>Please note new email address:

>Richard Fell
>13 Davida Road
>Burlington, Ma 01803
>(781)273-2126</pre>
>&nbsp;</html>

>--------------176DA4184BD1239EA0E9F6AA--

Lew Pitcher
Information Technology Consultant
Toronto Dominion Bank Financial Group


(Opinions expressed are my own, not my employer's.)

 
 
 

more help needed with changing root password

Post by Lew Pitch » Wed, 28 Feb 2001 04:00:07


One other thing... _which_ /etc/passwd did you edit?

If I understand correctly, you've booted tomsrtbt in order to recover
your system. tomsrtbt has it's own password file, which (when you're
in tomsrtbt) is located in /etc/passwd. OTOH, _your_ password file
(while you in tomsrtbt) is on one of the harddisk partitions, which
may not be mounted.

You have to
- boot into tomsrtbt and sign on as root
- mount your usual root device (i.e. /dev/hda1) onto /mnt
- edit the /mnt/etc/passwd file and save
- umount /mnt
- shutdown -r now
- reboot as per normal

Likely, you edited the tomsrtbt /etc/passwd file, which (IIRC) is kept
in ramdisk. This is not the password file that your regular system
uses.

Lew Pitcher
Information Technology Consultant
Toronto Dominion Bank Financial Group


(Opinions expressed are my own, not my employer's.)

 
 
 

more help needed with changing root password

Post by richard noel fel » Wed, 28 Feb 2001 05:22:58



> One other thing... _which_ /etc/passwd did you edit?

> If I understand correctly, you've booted tomsrtbt in order to recover
> your system. tomsrtbt has it's own password file, which (when you're
> in tomsrtbt) is located in /etc/passwd. OTOH, _your_ password file
> (while you in tomsrtbt) is on one of the harddisk partitions, which
> may not be mounted.

> You have to
> - boot into tomsrtbt and sign on as root
> - mount your usual root device (i.e. /dev/hda1) onto /mnt
> - edit the /mnt/etc/passwd file and save

Did all of the above.

Quote:> - umount /mnt

But did not do this.
However, I checked my /etc/passwd file after rebooting and it did reflect
the changes I made.
*

> - shutdown -r now
> - reboot as per normal

> Likely, you edited the tomsrtbt /etc/passwd file, which (IIRC) is kept
> in ramdisk. This is not the password file that your regular system
> uses.

> Lew Pitcher
> Information Technology Consultant
> Toronto Dominion Bank Financial Group


> (Opinions expressed are my own, not my employer's.)

--
Please note new email address:

Richard Fell
13 Davida Road
Burlington, Ma 01803
(781)273-2126

 
 
 

more help needed with changing root password

Post by Lew Pitch » Wed, 28 Feb 2001 04:19:16





>> One other thing... _which_ /etc/passwd did you edit?

>> If I understand correctly, you've booted tomsrtbt in order to recover
>> your system. tomsrtbt has it's own password file, which (when you're
>> in tomsrtbt) is located in /etc/passwd. OTOH, _your_ password file
>> (while you in tomsrtbt) is on one of the harddisk partitions, which
>> may not be mounted.

>> You have to
>> - boot into tomsrtbt and sign on as root
>> - mount your usual root device (i.e. /dev/hda1) onto /mnt
>> - edit the /mnt/etc/passwd file and save

>Did all of the above.

>> - umount /mnt

>But did not do this.
>However, I checked my /etc/passwd file after rebooting and it did reflect
>the changes I made.

Well,Dave, you have me stumped!

P'haps it's time to try the 'linux single' boot.
If that doesn't work, then I'm out of ideas.

Lew Pitcher
Information Technology Consultant
Toronto Dominion Bank Financial Group


(Opinions expressed are my own, not my employer's.)

 
 
 

more help needed with changing root password

Post by Lew Pitch » Wed, 28 Feb 2001 04:20:27





>> One other thing... _which_ /etc/passwd did you edit?

>> If I understand correctly, you've booted tomsrtbt in order to recover
>> your system. tomsrtbt has it's own password file, which (when you're
>> in tomsrtbt) is located in /etc/passwd. OTOH, _your_ password file
>> (while you in tomsrtbt) is on one of the harddisk partitions, which
>> may not be mounted.

>> You have to
>> - boot into tomsrtbt and sign on as root
>> - mount your usual root device (i.e. /dev/hda1) onto /mnt
>> - edit the /mnt/etc/passwd file and save

>Did all of the above.

>> - umount /mnt

>But did not do this.
>However, I checked my /etc/passwd file after rebooting and it did reflect
>the changes I made.

Well, Richard, you have me stumped!

P'haps it's time to try the 'linux single' boot.
If that doesn't work, then I'm out of ideas.

Lew Pitcher
Information Technology Consultant
Toronto Dominion Bank Financial Group


(Opinions expressed are my own, not my employer's.)

 
 
 

more help needed with changing root password

Post by richard noel fel » Wed, 28 Feb 2001 05:48:27


Okay. I tried the linux single boot and that part went seamlessly. At the
shell prompt, I entered passwd and got the error message: passwd:Can not
identify you.
Then, I tried to log in as root and of course it prompted me for a password.
Then, on I tried to su and got the message 'user root does not exist'. Then,
I tried to reboot pressing ctrl-alt-del and got the message: 'You don't exist
- go away'. What a mess.

I had to power down in order to reboot. All this has occured since I ran
up2date a few days ago. I wonder if there is a correlation? I hate the idea
of having to reinstall the software. Does that seem the only next
alternative, unless I can add user root somehow?
Thanks again,
* Fell





> >> One other thing... _which_ /etc/passwd did you edit?

> >> If I understand correctly, you've booted tomsrtbt in order to recover
> >> your system. tomsrtbt has it's own password file, which (when you're
> >> in tomsrtbt) is located in /etc/passwd. OTOH, _your_ password file
> >> (while you in tomsrtbt) is on one of the harddisk partitions, which
> >> may not be mounted.

> >> You have to
> >> - boot into tomsrtbt and sign on as root
> >> - mount your usual root device (i.e. /dev/hda1) onto /mnt
> >> - edit the /mnt/etc/passwd file and save

> >Did all of the above.

> >> - umount /mnt

> >But did not do this.
> >However, I checked my /etc/passwd file after rebooting and it did reflect
> >the changes I made.

> Well, Richard, you have me stumped!

> P'haps it's time to try the 'linux single' boot.
> If that doesn't work, then I'm out of ideas.

> Lew Pitcher
> Information Technology Consultant
> Toronto Dominion Bank Financial Group


> (Opinions expressed are my own, not my employer's.)

--
Please note new email address:

Richard Fell
13 Davida Road
Burlington, Ma 01803
(781)273-2126

 
 
 

more help needed with changing root password

Post by Jean-David Beye » Wed, 28 Feb 2001 05:03:49



> Sorry to be such a bother, but this is not going as smoothly as I had hoped.

> I edited, via the rescue disk, the /etc/passwd file for my root entry to

> root::0:root:/root:/bin/bash. Now, when I reboot, when I try to log in as root, I am prompted for a password. Of course

> this is what I was trying to avoid in the first place. Is not my entry for root in etc/passwd correct to allow me

> to log on without a password?

Could your problem be that you are using shadow passwords and you
should be editing /etc/shadow instead of /etc/passwd?

--
 .~.  Jean-David Beyer           Registered Linux User 85642.
 /V\                             Registered Machine    73926.
/( )\ Shrewsbury, New Jersey     http://counter.li.org
^^-^^ 3:00pm up 5 days, 22:33, 4 users, load average: 3.11, 3.18, 3.01

 
 
 

more help needed with changing root password

Post by richard noel fel » Wed, 28 Feb 2001 11:25:12


Possibly. How do I edit /etc/shadow? The file is not readable by emacs, for instance.
Thanks again for any help,
* Fell



> > Sorry to be such a bother, but this is not going as smoothly as I had hoped.

> > I edited, via the rescue disk, the /etc/passwd file for my root entry to

> > root::0:root:/root:/bin/bash. Now, when I reboot, when I try to log in as root, I am prompted for a password. Of course

> > this is what I was trying to avoid in the first place. Is not my entry for root in etc/passwd correct to allow me

> > to log on without a password?

> Could your problem be that you are using shadow passwords and you
> should be editing /etc/shadow instead of /etc/passwd?

> --
>  .~.  Jean-David Beyer           Registered Linux User 85642.
>  /V\                             Registered Machine    73926.
> /( )\ Shrewsbury, New Jersey     http://www.veryComputer.com/
> ^^-^^ 3:00pm up 5 days, 22:33, 4 users, load average: 3.11, 3.18, 3.01

--
Please note new email address:

Richard Fell
13 Davida Road
Burlington, Ma 01803
(781)273-2126

 
 
 

more help needed with changing root password

Post by Jean-David Beye » Wed, 28 Feb 2001 11:31:37



> Possibly. How do I edit /etc/shadow? The file is not readable by
> emacs, for instance.

The file IS readable by emacs, vi, or whatever your favorite text
editor might be. It is readable and writable only by the super-user.

> Thanks again for any help,
>* Fell


> > > Sorry to be such a bother, but this is not going as smoothly as
> > I had hoped.

> > > I edited, via the rescue disk, the /etc/passwd file for my root
> > entry to

> > > root::0:root:/root:/bin/bash. Now, when I reboot, when I try to
> > log in as root, I am prompted for a password. Of course

> > > this is what I was trying to avoid in the first place. Is not my
> > entry for root in etc/passwd correct to allow me

> > > to log on without a password?

> > Could your problem be that you are using shadow passwords and you
> > should be editing /etc/shadow instead of /etc/passwd?

--
 .~.  Jean-David Beyer           Registered Linux User 85642.
 /V\                             Registered Machine    73926.
/( )\ Shrewsbury, New Jersey     http://www.veryComputer.com/
^^-^^ 9:15pm up 5:14, 3 users, load average: 2.08, 2.07, 2.01
 
 
 

more help needed with changing root password

Post by Peter T. Breue » Wed, 28 Feb 2001 13:42:04



Quote:> Possibly. How do I edit /etc/shadow? The file is not readable by emacs, for instance.

It's readable by anything. Do you mean that its permissions bits are
set to 000? You are root. Or just don't use shadow. What is the point
of using shadow for you?  Do you have multiple users on your system?
If not, run pwunconv, and be happy editing passwd.

Peter

 
 
 

more help needed with changing root password

Post by Jean-David Beye » Wed, 28 Feb 2001 21:38:50




> > Possibly. How do I edit /etc/shadow? The file is not readable by emacs, for instance.

> It's readable by anything. Do you mean that its permissions bits are
> set to 000? You are root. Or just don't use shadow. What is the point
> of using shadow for you?  Do you have multiple users on your system?
> If not, run pwunconv, and be happy editing passwd.

Is that a good idea? Once you run pwunconv, everything is as in the
bad old days. Someone could copy his /etc/passwd out the Internet,
crack the password file at his leasure, and then make a mess of
things. What if this user were using only the 8-byte encryption of the
passwords in the /etc/passwd as well?

Or did you mean that he should pwunconv, edit /etc/passwd, and then
pwconv to put things back?

--
 .~.  Jean-David Beyer           Registered Linux User 85642.
 /V\                             Registered Machine    73926.
/( )\ Shrewsbury, New Jersey     http://counter.li.org
^^-^^ 7:35am up 15:34, 3 users, load average: 1.42, 1.20, 1.12

 
 
 

more help needed with changing root password

Post by Lew Pitch » Wed, 28 Feb 2001 21:59:56




>Possibly. How do I edit /etc/shadow? The file is not readable by emacs, for instance.
>Thanks again for any help,
>Dick Fell


>> > Sorry to be such a bother, but this is not going as smoothly as I had hoped.

>> > I edited, via the rescue disk, the /etc/passwd file for my root entry to

>> > root::0:root:/root:/bin/bash. Now, when I reboot, when I try to log in as root, I am prompted for a password. Of course

>> > this is what I was trying to avoid in the first place. Is not my entry for root in etc/passwd correct to allow me

>> > to log on without a password?

>> Could your problem be that you are using shadow passwords and you
>> should be editing /etc/shadow instead of /etc/passwd?

I just tried a quick test on my 'shadow-enabled' Linux box, and
deleting the password mark from /etc/passwd works as I described
(logon doesn't require a password). My guess is that you have some
other password management package enabled (i.e. PAM perhaps?), and it
is interfering here.

Since I don't use PAM, I can't tell you how to disable it. IIRC,
there's a /etc/pam.conf file (or something of that nature) that
contains the PAM config. Perhaps, if you use PAM, you can look for the
config file, and see what can be done to disable it.

Lew Pitcher
Information Technology Consultant
Toronto Dominion Bank Financial Group


(Opinions expressed are my own, not my employer's.)

 
 
 

more help needed with changing root password

Post by Peter T. Breue » Thu, 01 Mar 2001 12:16:17




> Is that a good idea? Once you run pwunconv, everything is as in the
> bad old days. Someone could copy his /etc/passwd out the Internet,

How? They have to get on to his machine to read it, and if they
have got on to his machine, then they don't need to read it.

Quote:> crack the password file at his leasure, and then make a mess of
> things. What if this user were using only the 8-byte encryption of the
> passwords in the /etc/passwd as well?

8-byte encryption? Not sure what you mean but the standard unix
passwd encryption is perfectly safe by all reasonable measures.

Quote:> Or did you mean that he should pwunconv, edit /etc/passwd, and then
> pwconv to put things back?

I meant that there is no point in using shadow on a system that
doesn't have any other users to protect the passwd file from.

Peter

 
 
 

more help needed with changing root password

Post by Jean-David Beye » Fri, 02 Mar 2001 21:47:56





> > Is that a good idea? Once you run pwunconv, everything is as in the
> > bad old days. Someone could copy his /etc/passwd out the Internet,

> How? They have to get on to his machine to read it, and if they
> have got on to his machine, then they don't need to read it.

They might get on as an ordinary user (by maladministration of the
system) and read /etc/passwd so as to crack the root password. They
might have sniffed somebody's telnet sessions, for example, or nfs may
not be securely set up.

Quote:

> > crack the password file at his leasure, and then make a mess of
> > things. What if this user were using only the 8-byte encryption of the
> > passwords in the /etc/passwd as well?

> 8-byte encryption? Not sure what you mean but the standard unix
> passwd encryption is perfectly safe by all reasonable measures.

I was thinking that the MD5 encryption of passwords, that permit
passwords to be over 8 characters long (255 characters max, IIRC), was
more secure than the old crypt(3) encryption with the Enigma 3-rotor
scheme that has long been the default.
Quote:

> > Or did you mean that he should pwunconv, edit /etc/passwd, and then
> > pwconv to put things back?

> I meant that there is no point in using shadow on a system that
> doesn't have any other users to protect the passwd file from.

I see we have different viewpoints. My view is that if you have more
than one user (e.g., root and at least one other is more than one),
that the bad guy might guess (by sniffing or otherwise) the non-root
login sequence and then he could read /etc/passwd from which he could
probably crack the root password given the desire and time.

--
 .~.  Jean-David Beyer           Registered Linux User 85642.
 /V\                             Registered Machine    73926.
/( )\ Shrewsbury, New Jersey     http://counter.li.org
^^-^^ 7:40am up 2 days, 15:38, 3 users, load average: 1.01, 1.08, 1.08