Copying Samba users from one server to another

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.

  1. On the source server export the user database.  In this example we use smbpasswd format.
    pdbedit -e smbpasswd:/root/samba-users.backup
  2. Copy the file to the second samba server.
  3. Import the backup into the password database.
    pdbedit -i smbpasswd:/root/samba-users.backup

That’s it.

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.


3 thoughts on “Copying Samba users from one server to another

    1. If your only accessing the files via Samba shares, then no. However, it will make your life easier if they do for the simple reason you won’t have to change the owner and group of all your files to the new values.

  1. Thank you very much. That was exactly what I wanted to so and it worked perfectly. I did make sure the that UIDs matched – changing the file owners would have been much more of a pain.

Leave a Reply

Your email address will not be published. Required fields are marked *