nidump/niload are your friends...
Open terminal,
On the first Mac :
nidump passwd . > passwd.txt
nidump group . > group.txt
Copy passwd.txt and group.txt files on the new Mac, open Terminal and :
sudo niload passwd . < passwd.txt
sudo niload group . < group.txt
For further information, see manual pages :
man nidump
man niload
man niutil
(the examples above assume that the files are created/copied in the users'home directory.)