On Fri, March 3, 2006 1:51 pm, Eric Peterson wrote:
> On 3/3/06, Raymond Norton <admin at lctn.org> wrote:
>> I'm setting up a new mail server and have moved over the necessary user
>> files. Is there a way to copy the info from the old
>> server  /etc/passwd, /etc/group , and /etc/shadow to the same files on
>> the new server, without writing over existing entries or creating
>> duplicates?

It's definitely best to eyeball it with Vim (even if you use automation),
but automation, well, frees time:

cat /etc/<file> <new file> | cut -d: -f <n> | sort | uniq -d | uniq

works for finding duplicate names (n=1) with /etc/{group,passwd,shadow}
works for finding duplicate UID/GID (n=3) with /etc/{group,passwd}

if you get the outputs to be empty by tweaking either of the files, and
then append the new to the system copy, you should be safe.  run
{pw,grp}ck for peace of mind.

-=-=-=-=-=-=-=-
David Carlson
thecubic at thecubic.net