0

I have to migrate a Samba 3 to a new Samba 4 server.

My problem is that the database on the samba 3 server seems a bit empty. The secrets.dtb file is only 20K whereas the “pbedit -L |wc -l”command give me 16970 lines.

On my Samba3 /var/lib/samba is 1,5M

After I had migrate the databse (following instructions on http://dev.tranquil.it/index.php/SAMBA_-_Migration_Samba3_Samba4), “pdbedit -L” command on the new server give me only : SAMBA4$, Administrator, dns-samba4, krbtgt and nobody.

So I tried to create a VM with a Samba3. I added some users, done the same things I did for the migration and now I can see the users created on the VM.

It’s like users on the Samba 3 server are in a sort of cache.

I already migrate the /etc/{passwd,shadow,group} files and I can see users with the “getent passwd” command.

Any ideas why my users are present when I use pdbedit but the database is so empty ?

The global part of my smb.conf on the Samba 3 server :

  [global]
   workgroup = INTERNET
   netbios name = PDC-SMB3
   server string = %h server
   interfaces = eth0
   obey pam restrictions = Yes
   passdb backend = smbpasswd
   passwd program = /usr/bin/passwd %u
   passwd chat = *new* %n\n *Re* %n\n *pa*
   username map = /etc/samba/smbusers
   unix password sync = Yes
   syslog = 0
   log file = /var/log/samba/log.%U
   max log size = 1000
   socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
   add user script = /usr/sbin/useradd -s /bin/false -m '%u' -g users
   delete user script = /usr/sbin/userdel -r '%u'
   add group script = /usr/sbin/groupadd '%g'
   delete group script = /usr/sbin/groupdel '%g'
   add user to group script = /usr/sbin/usermod -G '%g' '%u'
   add machine script = /usr/sbin/useradd -s /bin/false -d /dev/null '%u' -g machines
   logon script = logon.cmd
   logon home = \\$L\%U
   domain logons = Yes
   os level = 255
   preferred master = Yes
   local master = Yes
   domain master = Yes
   dns proxy = No
   ldap ssl = no
   panic action = /usr/share/samba/panic-action %d
   invalid users = root
   admin users = admin, root, administrateur
   log level = 2

1 Answer 1

1

I find a way to do it.

I used "pdbedit -e smbpasswd:/root/samba-users.bak" on the Samba 3 server to export users. Then I did a "pdbedit -i /root/samba-users.bak" on the Samba 4 server where /root/samba-users.bak is the file that I copied from the Samba 3 server. Of course, I already imported users from the old server to the new one.

1
  • correct: pdbedit -i smbpasswd:/root/samba-users.bak
    – user295652
    Jun 23, 2015 at 7:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .