sudo ditto --rsrc --acl path/to/old/machine/Users/ path/to/new/machine/Users/
That will do it.
The Long Story:
All my Macs are joined to Active Directory. Most are common area machines (labs, kiosks, etc) but a few have one or a handful of regular users of those machines. I needed to upgrade them to new machines, and transfer their accounts to new machines. Normally, this would be done using Migration Assistant, but since they are AD users, without the option to force the home directory on the local disk, they don’t appear in System Preferences\Accounts, so Migration Assistant doesn’t see them, even though they have folders in /Users/ on the local machine. I connected the two machines together with a FireWire cable and booted into Target Disk Mode (hold the T key at startup on the old machine), and ran the above command in the Terminal.
You may be asking, “why not just copy with the Finder, or use the mv command in Terminal?” Doing either of these will result in the OS not recognizing that the user folders are linked to accounts, and it will treat them as regular folders with files, and generic permissions. Using this command makes an exact copy of each /Users/ folder on the old machine, in the same location on the new machine. The two switches will preserve resource forks (not really relevant in Snow Leopard and above, but the old machines were running Tiger), and preserve Access Control Lists (ACLs) so all permissions remain in tact.
Simply reboot the new machine before attempting to log in again, and everything should be as it was on the old machine.