I have a cluster of 100 iMacs and I wanted to replicate all the accounts via SSH, in linux, I wrote a very simple script in which copies the /etc/passwd*/etc/group*/etc/shadow* to /etc in each node, but I can't do this in Mac OSX just like that. How can I do something similar like this in OSX?

That's exactly why I wanted to avoid, using any of those three options, as far as I've reached is that I used dsexport to create a backup of users and groups then copy those files to the other machines and use dsimport to import that information, the users are created, but then the passwords for the accounts that didn't exist just don't work, any ideas? :-(
–
natorroApr 13 '11 at 19:02

You should be able to use the same approach on OS X, except that the relevant files to clone are /var/db/dslocal/nodes/Default/users/*, /var/db/dslocal/nodes/Default/groups/*, and /var/db/shadow/hash/*. I haven't tested this, but it should work.

@natorro: Glad to hear it. Can you mark this answer as accepted? BTW, the /var/db/shadow/hash directory contains both password hash files and ".state" files that track things like the time of last successful login, number of authentication failures, etc. It would actually be a bit better (though not very important) to clone only the hash files, not the .state files. Here's a shell pattern to match just the hash files: /var/db/shadow/hash/*[A-Z0-9]
–
Gordon DavissonApr 14 '11 at 15:32