Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Sep 2002 17:12:49 +1000
From:      Greg Lane <gregory.lane@anu.edu.au>
To:        Danny <dannyho@bigpond.net.au>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Upgrading using /stand/sysinstall
Message-ID:  <20020924071249.GA45003@nucl03.anu.edu.au>
In-Reply-To: <000e01c2638f$588cc990$bf01a8c0@x.com>
References:  <000d01c25f9c$d614cee0$bf01a8c0@x.com> <20020919053946.GA15586@nucl03.anu.edu.au> <05d701c2630c$97d548d0$bf01a8c0@x.com> <20020924040042.GA44003@nucl03.anu.edu.au> <000e01c2638f$588cc990$bf01a8c0@x.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Sep 24, 2002 at 03:58:03PM +1000, Danny <dannyho@bigpond.net.au> wrote:
> Dear Gregory,
> 
> I found the old files by typing in /usr/libexec/locate.updatedb -
> 
> locate master.passwd
> 
> backup# ls
> aliases.bak             group.bak2              master.passwd.bak2
> group.bak               master.passwd.bak
> backup# pwd
> /var/backups
> 
> When you say I should merge them to the new password files does it mean I
> issue the following commands to copy the old passwords, groups overs
> 
> cat aliases.bak > /etc/aliases
> cat group.bak > /etc/group
> cat master.passwd.bak > /etc/master.passwd
> 
>  Yours faithfullly
> 
> dannyho@bigpond.net.au

G'day Danny,

What I mean by merge, is that if you do something like:

diff /etc/master.passwd /var/master.passwd.bak

and:

diff /etc/group /var/group.bak

you will see that a number of groups and users have been added 
to the passwd and group files since the version you were 
running (4.3?), and the groups and users that you had 
added are not present. 

You need to merge your old added groups and users into 
the current group and passwd files (which already contain the new
groups and users added by the upgrade). 

Although there is probably a more elegant way, I would do it by
using vipw to edit the current /etc/master.passwd file and manually
add your old entries from /var/master.passwd.back to it. When you 
exit vipw, it will update the passwd database (/etc/pwd.db) for you. 

You will have to do the same thing with /etc/group but with a
normal editor, not vipw. There is no groups database to update
that I am aware of.

Note that if you don't like vi, you can set the EDITOR variable 
to point to your editor of choice (emacs, ee) before you run vipw.
Make sure you delete any backup files that are created if you use 
(for example) emacs!

I'm sure the experts out there will think of numerous more
clever methods, but this should work.

One other point. The aliases file is for email, not logging 
in. To setup the aliases file I think you are supposed
to copy your backed up aliases file to /etc/mail/aliases, 
cd to /etc/mail and then type "make aliases" to create the 
/etc/mail/aliases.db file for sendmail.

I think this should be OK, but I would make extra backups of 
all the files before you do anything just in case. I'm self
taught and not an expert!

Cheers,
Greg

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020924071249.GA45003>