The general flow of the task is to:
#!/bin/sh echo "$1"
uid-merge is a program that you just give a series of password files to on the command line, like:
Here's an example of the sort of input and output you might expect:
seki-strombrg> for i in *; do echo $i; sed 's/^/ /' < $i; done domain1 user1:x:10000:600::/tmp:/bin/bash user2:x:10000:600::/tmp:/bin/bash user3:x:10001:600::/tmp:/bin/bash user4:x:10002:600::/tmp:/bin/bash user5:x:10003:600::/tmp:/bin/bash user6:x:10004:600::/tmp:/bin/bash domain1-paths #!/bin/sh echo /domain1"$1" domain2 domain2a:x:20000:600::/tmp:/bin/bash domain2b:x:20001:600::/tmp:/bin/bash domain2c:x:20001:600::/tmp:/bin/bash domain2d:x:10002:600::/tmp:/bin/bash domain2e:x:20003:600::/tmp:/bin/bash domain2f:x:20004:600::/tmp:/bin/bash domain2-paths #!/bin/sh echo /domain2"$1" domain3 domain3a:x:30000:600::/tmp:/bin/bash domain3b:x:30001:600::/tmp:/bin/bash domain3c:x:10001:600::/tmp:/bin/bash domain3d:x:10002:600::/tmp:/bin/bash domain3e:x:30003:600::/tmp:/bin/bash domain3f:x:20004:600::/tmp:/bin/bash domain3-paths #!/bin/sh echo /domain3"$1" Mon Oct 17 12:47:19 seki-strombrg> uid-merge domain1 domain2 domain3 chown domain3 20004 100 chown domain3 10001 101 chown domain2 10002 102 chown domain3 10002 103 pwent domain3f:x:100:600::/domain3/tmp:/bin/bash pwent domain3c:x:101:600::/domain3/tmp:/bin/bash pwent domain2d:x:102:600::/domain2/tmp:/bin/bash pwent domain3d:x:103:600::/domain3/tmp:/bin/bash pwent user1:x:10000:600::/domain1/tmp:/bin/bash pwent user2:x:10000:600::/domain1/tmp:/bin/bash pwent user3:x:10001:600::/domain1/tmp:/bin/bash pwent user4:x:10002:600::/domain1/tmp:/bin/bash pwent user5:x:10003:600::/domain1/tmp:/bin/bash pwent user6:x:10004:600::/domain1/tmp:/bin/bash pwent domain2a:x:20000:600::/domain2/tmp:/bin/bash pwent domain2b:x:20001:600::/domain2/tmp:/bin/bash pwent domain2c:x:20001:600::/domain2/tmp:/bin/bash pwent domain2e:x:20003:600::/domain2/tmp:/bin/bash pwent domain2f:x:20004:600::/domain2/tmp:/bin/bash pwent domain3a:x:30000:600::/domain3/tmp:/bin/bash pwent domain3b:x:30001:600::/domain3/tmp:/bin/bash pwent domain3e:x:30003:600::/domain3/tmp:/bin/bash Mon Oct 17 12:47:28So you just save that output in a file with ">", and sed apart the pieces:
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.
You can e-mail the author with questions or comments: