On Sat, Sep 29, 2001 at 11:25:45PM +0500, Rai hardeep singh wrote:
>
> On Sat, 29 Sep 2001, Cacofonixx the bard wrote:
>
> > very funny man .. afaik everyone does not have the same
> > file .. and unless im dead wrong .. loads of my frds at
> > roorkee have linux .. why not take it from them ... why
> > bother the group ..
>
> I consider all list members my friends. Rather I would like
> you to become my friend, and a friend in need is a friend
> in deed.
>
> > --- Rai hardeep singh <[EMAIL PROTECTED]> wrote:
> > > I feel my most of problems are due to overwriting passwd
> > > and shadow files with my previous file.
---end quoted text---
Hardeep,
Forget what has transpired above ... you will go nowhere
with the kind of approach you are taking. If I read you right:
a) You have accidentally overwritten /etc/passwd
b) You want to get your users back on track ...
Copying a /etc/passwd from another installation will not do
because all of them will be different. You need to recover all
your users and passwords yourself for your box:
Step 1: Your /etc/pasword has all junk. You can kill all
users in it except for root and processes (viz .
uid > 100).
Step 2: Recover root password (see LOST tip below)
Step 3: Check which all users (names) you have in /home
Step 4: Use adduser and create a new user for all of them
using the SAME user name and a fresh password ...
which can subsequently be changed. Keep a log of
this bit on paper.
Step 5: All files belonging to the users would have their
uid:gid all topsy turvy ... as root you need to
set this right. Assume you have an user called
bish in the group users, you need to do:
#chown bish.users /home/bish/*
and to be repeated for all dirs under /home/bish.
NOTE : In case the old /etc/passwd has some valid user-
names but passwords have changed you can change the pass-
word alone as root using the passwd command. Script out-
put from my box is attached. Old passwords NOT needed !
aedes:~#passwd bish
Changing password for bish
Enter the new password (minimum of 5, maximum of 127 characters)
Please use a combination of upper and lower case letters and numbers
New password:
This is not the first time that I have come across this
problem, but the approach to the problem is above .. copying
some other /etc/passwd will only complicate matters !
HTH
Bish.
--
:
####[ Linux One Stanza Tip (LOST) ]###########################
Sub : Loss of root password LOST #029
Log in to Single user mode. At the LILO boot prompt type in:
linux 1 init=/bin/sh root=/dev/hdaN mount rw
(where N is the number of your root partition)
Then change the password for root with the command:
#passwd
####<[EMAIL PROTECTED]>####################################
:
_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help