I really did it now, screwed up /etc/passwd

I really did it now, screwed up /etc/passwd

Post by Gag » Tue, 26 Jun 2001 04:01:48



Hello all.

I modified my /etc/passwd earlier today to modify a persons account on
my linux machine. problem is I made a typo and here is his home
account:

/home/glenn./ where it should be /home/glenn/./

so when i log in as ANYONE, it says cant find directory and boots me
out. i tried logging in single user and when i give my linux password
it cant find the directory and boots me out.

any one willing to answer my plea for help? Thanks!

 
 
 

I really did it now, screwed up /etc/passwd

Post by Bill Unr » Tue, 26 Jun 2001 04:30:12



]I modified my /etc/passwd earlier today to modify a persons account on
]my linux machine. problem is I made a typo and here is his home
]account:

]/home/glenn./ where it should be /home/glenn/./

]so when i log in as ANYONE, it says cant find directory and boots me
]out. i tried logging in single user and when i give my linux password
]it cant find the directory and boots me out.

I do not think that line is the problem, since /home/glenn./ could well be a valid
name. I would suspect you stuck in a blank line somewhere or did something else
badly. Can you log in as root?
(by the way, why in the world would you have a home directory of /home/glenn/./?
That ./ is unneccesary.)

 
 
 

I really did it now, screwed up /etc/passwd

Post by Dave Uhrin » Tue, 26 Jun 2001 06:43:19




> (Gage) writes:

> ]I modified my /etc/passwd earlier today to modify a persons account on
> ]my linux machine. problem is I made a typo and here is his home
> ]account:

> ]/home/glenn./ where it should be /home/glenn/./

> ]so when i log in as ANYONE, it says cant find directory and boots me
> ]out. i tried logging in single user and when i give my linux password
> ]it cant find the directory and boots me out.

> I do not think that line is the problem, since /home/glenn./ could well be
> a valid name. I would suspect you stuck in a blank line somewhere or did
> something else badly. Can you log in as root?
> (by the way, why in the world would you have a home directory of
> /home/glenn/./? That ./ is unneccesary.)

Boot from an install CD - I know that Slackware's works and leaves you in a
shell.  Mount your / partition on /mnt and edit the passwd file with vi.  
Reboot.
 
 
 

I really did it now, screwed up /etc/passwd

Post by news1.sympatico.c » Tue, 26 Jun 2001 06:54:19


1) You could give some command like shell=/bin/bash or something to get
going I think, on single user mode.
2) As far as I know ( and belive me, soz i spent the last 6 hours booting
and rebooting into single user mode ) , going single user does not ask for a
root password. it is asked when a normal startup fails and then the scripts
drop you into single mode.

3) The trailing ./ is needed to chroot people ftp-ing in, when one uses
proFTPd.

later.

joseph


Quote:> Hello all.

> I modified my /etc/passwd earlier today to modify a persons account on
> my linux machine. problem is I made a typo and here is his home
> account:

> /home/glenn./ where it should be /home/glenn/./

> so when i log in as ANYONE, it says cant find directory and boots me
> out. i tried logging in single user and when i give my linux password
> it cant find the directory and boots me out.

> any one willing to answer my plea for help? Thanks!

 
 
 

I really did it now, screwed up /etc/passwd

Post by Jerry Krep » Tue, 26 Jun 2001 07:00:39



> Hello all.

> I modified my /etc/passwd earlier today to modify a persons account
> on my linux machine. problem is I made a typo and here is his home
> account:

> /home/glenn./ where it should be /home/glenn/./

> so when i log in as ANYONE, it says cant find directory and boots me
> out. i tried logging in single user and when i give my linux
> password it cant find the directory and boots me out.

> any one willing to answer my plea for help? Thanks!

Is there a reason you can log in as root and fix things?
 
 
 

I really did it now, screwed up /etc/passwd

Post by Jerry Krep » Tue, 26 Jun 2001 07:07:15




> > Hello all.

> > I modified my /etc/passwd earlier today to modify a persons
> > account on my linux machine. problem is I made a typo and here is
> > his home account:

> > /home/glenn./ where it should be /home/glenn/./

> > so when i log in as ANYONE, it says cant find directory and boots
> > me out. i tried logging in single user and when i give my linux
> > password it cant find the directory and boots me out.

> > any one willing to answer my plea for help? Thanks!

Is there a reason you can not log in as root and fix things?
 
 
 

I really did it now, screwed up /etc/passwd

Post by Gag » Tue, 26 Jun 2001 09:10:34


I made a rescue disk set just now and can mount my partition from it.
but even when I edit the passwd file it wont let me log in :/

so what i am doing is downloading servu ftp trial and will back up
everything onto this comp. thanks for the help anyways :)


> 1) You could give some command like shell=/bin/bash or something to get
> going I think, on single user mode.
> 2) As far as I know ( and belive me, soz i spent the last 6 hours booting
> and rebooting into single user mode ) , going single user does not ask for a
> root password. it is asked when a normal startup fails and then the scripts
> drop you into single mode.

> 3) The trailing ./ is needed to chroot people ftp-ing in, when one uses
> proFTPd.

> later.

> joseph



> > Hello all.

> > I modified my /etc/passwd earlier today to modify a persons account on
> > my linux machine. problem is I made a typo and here is his home
> > account:

> > /home/glenn./ where it should be /home/glenn/./

> > so when i log in as ANYONE, it says cant find directory and boots me
> > out. i tried logging in single user and when i give my linux password
> > it cant find the directory and boots me out.

> > any one willing to answer my plea for help? Thanks!

 
 
 

I really did it now, screwed up /etc/passwd

Post by Dave Uhrin » Tue, 26 Jun 2001 11:05:31



> I made a rescue disk set just now and can mount my partition from it.
> but even when I edit the passwd file it wont let me log in :/

> so what i am doing is downloading servu ftp trial and will back up
> everything onto this comp. thanks for the help anyways :)

Edit /etc/shadow since that is where the password is actually kept.
 
 
 

I really did it now, screwed up /etc/passwd

Post by Eric » Tue, 26 Jun 2001 22:44:30


Quote:> I made a rescue disk set just now and can mount my partition from it.
> but even when I edit the passwd file it wont let me log in :/

why not? Do you use /etc/shadow by any chance?
Explain what fails, or we cannot help you.

Quote:> so what i am doing is downloading servu ftp trial and will back up
> everything onto this comp. thanks for the help anyways :)

To back-up is never a bad idea.
Reinstalling usually is. It almost always is more work, especially if
you have tuned your system a lot.

Eric

 
 
 

I really did it now, screwed up /etc/passwd

Post by Julian T. J. Midgl » Tue, 26 Jun 2001 23:21:31




>1) You could give some command like shell=/bin/bash or something to get
>going I think, on single user mode.
>2) As far as I know ( and belive me, soz i spent the last 6 hours booting
>and rebooting into single user mode ) , going single user does not ask for a
>root password. it is asked when a normal startup fails and then the scripts
>drop you into single mode.

Not quite true.  Red Hat (and probably other distributions) are set up
not to require a password on entry to Single User mode.  Debian (and
maybe others) certainly requires a password.

Julian

--
Julian T. J. Midgley                    http://www.xenoclast.org
Cambridge, England.                       PGP Key ID: 0xBCC7863F

 
 
 

1. /etc/passwd file - am I screwed?!

This really should be a FAQ.  We get this same post at last 2-3 times
a week here.  I'll have to put this up on a web page......

Let me first start off with some advice for hand editting /etc/passwd
and /etc/shadow.

1)  ALWAYS copy /etc/passwd and /etc/shadow for safekeeping _before_
    you start working.
2)  After you've made the modifications log back into the machine
    to make sure you haven't toasted root's login.  Just do telnet
    localhost or 127.0.0.1 .  Then login as a regular user, followed
    by an su -.  If it fails then you can copy back the originals.

So, how do you fix your problem?

0)  From the <ok> prompt type in "printenv boot-device"
1)  Find an installation CD-ROM.  From the <OK> prompt type in
    "boot cdrom -s".
2)  Using the device found in step 0, mount up the root file system.
    If you have a 5, 10 or 20 the default device is c0t3.  If you have
    an Ultra Enterprise, the default device is c0t2.  You'll probably
    have to fsck it first.  My example assumes c0t3 is the boot disk.

        fsck /dev/rdsk/c0t3d0s0
        mount /dev/rdsk/c0t3d0s0 /mnt
        vi /etc/passwd

Fix root's shell.

3)  Reboot

That should do the trick.

--
       ___________________________________
      / John Kotches is cybernetically:  /\


   /                                  / /
  /  Technology: no place for wimps! / /
  \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

2. Input to bg process?

3. Help! I screwed up /etc/passwd

4. Memory=32 ..system sees 32MB Linus sees 16 only

5. Convert NIS passwd back to standard /etc/passwd & /etc/shadow

6. (patch for Bash) Fixed Field Width for 'read'

7. /etc/passwd & /etc/security/passwd

8. RedHat Linux 5.1 on 486/66, Hardware parameters

9. CDE vs. /etc/passwd, /etc/shadow and /etc/group

10. How to keep consistancy between /etc/passwd and NIS+ passwd table.

11. root passwd and /etc/passwd in linux single mode

12. how to keep the network passwd and /etc/passwd consistence in nis+

13. patch to support non-/etc/passwd passwd files