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.

 

Note on sharing a single LDAP database with multiple Samba servers

Quote:

“… to share a single set of users/groups in LDAP to multiple samba
servers you will need LDAP and a PDC and the other servers will be
BDCs. yes you will join BDC’s with net rpc join -D domain -S
pdc_server_name -U root%password

read chapter 5.3 of samba 3 by example.pdf”

– Adam Williams

Source: http://lists.samba.org/archive/samba/2008-August/142551.html

Samba performance on FreeBSD 8

The following is a forum post in the FreeBSD forums discussing how to get the best performance out of your Samba file server.

http://forums.freebsd.org/showthread.php?t=9187

Worth the read.

Setting up a Samba PDC setup using OpenLDAP on CentOS

I’m happy to announce my latest how-to, Setting up a Samba PDC setup using OpenLDAP on CentOS, is now available in the wiki.

Setting up a Samba PDC setup using OpenLDAP on CentOS describes how to setup a Samba PDC using OpenLDAP as the user database instead of the default flat files Samba uses.  It provides full sample configuration files and instructions on how to install and configure the smbldap tools.

I’ll be adding helper scripts for maintaining users, groups and machines at the command just like the ones in the Setting up a small scale Samba PDC on CentOS how-to.