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.
“… 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
The following is a forum post in the FreeBSD forums discussing how to get the best performance out of your Samba file server.
Worth the read.
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.