Thank all for the replies. This is the greatest mailing
list I have ever been on.
My original question:
> I added Rsherry to the /etc/passwd file to have the same uid and
> gid as root. Somehow all the files and dirctories originally owned by
> root are now owned by Rsherry. Command "chown" will not do anything,
> because Rsherry has the same uid as root. I deleted Rsherry from the
> passwd file hoping that will put things back to what they were. But
> they remain the same. It is really annoying.
>
> How can I have them changed back to owned by root?
Later I said I solve the problem by removing /etc/passwd.pag and passwd.dir.
Well, that is not quite a sysadmin solution. :-)
Correct solution:
Thanks to Patrick O'Brien <pobrien_at_draco.harvard.edu>
> Right; that's what mkpasswd does. It re-builds those
> files for faster lookups. The way to modify the passwd file is
> with vipw. It creates a lock on the passwd file, makes a backup
> of it in case your system crashes during the edits, and then
> when you're through editing, it runs mkpasswd to update passwd.pag
> and passwd.dir.
and Ray Bellis <rpb_at_psy.ox.ac.uk>
> Real answer: Always use `vipw' to edit the password file. The `passwd.pag'
> and `passwd.dir' files are hashed database files designed to speed up access
> to password information. When you edited the password file the database
> files weren't kept up to date, thus causing the problem you saw.
Thanks all that replied. I really appreciate it.
Michael A. Crowley <mcrowley_at_mhc.mtholyoke.edu> Thanks!
nicolis_at_celfi.phys.univ-tours.fr
vladimir_at_cfd1.eng.tau.ac.il
Danny J. Mitzel <dmitzel_at_everest.hitc.com>
Ray Bellis <rpb_at_psy.ox.ac.uk>
Michael R. Kline <mike_at_lib.utexas.edu>
Michel Cyr <cyrmiche_at_sidoci.qc.ca>
Sherry
Received on Mon Jun 19 1995 - 19:30:10 NZST