• This software is owned by The university of California, Irvine, and is not distributed under any version of the GPL. GPL is a fine series of licenses, but the owners of the software need it to be distributed under these terms.
    Presented here is a pair of programs for merging UID's between previously-distinct NIS domains or other forms of password databases.

    The general flow of the task is to:

    1. Transfer all of your password files to a central host, in a single directory, one file per domain
    2. Delete any accounts from the domain files you don't want to have in the resulting password file
    3. Create one "-paths" script for each domain. This script will change users' home directory paths. If you don't need homedirs changed, just use a NOOP -path script like:
        #!/bin/sh
        echo "$1"
        
    4. Run uid-merge until you get a series of pwent and chown lines
    5. If it errors out, you probably have username collisions, which need to be resolved manually. I like to contact both users, see if they're the same person, ask them which homedir they'd like to be made a subdir of the other. If they're two different people, that may make the merge policitally complex, but one approach is to ask both of them to vacate the username, give them two new ones, and put a vacation message on the old one explaining what happened.
    6. sed apart the output into a password file and a series of chowns files
    7. Run the chowns on each host with user files in the former password domains
    8. Install your new password file

    uid-merge is a program that you just give a series of password files to on the command line, like:

    In this example, domain1's uid's will vary least frequently in the event of UID collisions, and domain3 will very most frequently.

    Here's an example of the sort of input and output you might expect:

    So you just save that output in a file with ">", and sed apart the pieces: As it happens, the chowns-input for domain "domain1" probably will be empty.

    You then go to each domain (except the first listed on the uid-merge line), feeding that "chowns-input" file into the "chowns" program. You'll probably want to run it on every file server and machine with non-network-accessible accounts, to get all the UID's changed appropriately. An example of chowns use is:

    Then you just install your new password file ("resulting-password-file") in /etc/passwd, or as your NIS password source file.

    Download here


    Hits: 3001
    Timestamp: 2024-12-26 07:07:39 PST

    Back to Dan's tech tidbits

    You can e-mail the author with questions or comments: