Coping Samba users from one server to another is not as difficult as it sounds.
The following steps require root access. pdbedit won’t work as a regular user.
- On the source server export the user database. In this example we use smbpasswd format.
pdbedit -e smbpasswd:/root/samba-users.backup
- Copy the file to the second samba server.
- Import the backup into the password database.
pdbedit -i smbpasswd:/root/samba-users.backup
It should be said, that if you are running multiple Samba servers and you want to have common users and groups, you should really be looking and a centralized user solution. Samba 3 By Example is a good place to start.