-1

I've read How to migrate Samba User Accounts to a new linux server? however it doesn't address my situation, or at least not with a solution.

I have a RHEL 5 machine, wood, running Samba, Dovecot, PostFix. I would like to move these services to another machine, stone which is Centos 6. Authentication is done via LDAP and PAM on both machines ( /etc/{passd*,shadow*} files have no user info - which is why the linked question doesn't help as that is what it suggest transfering ).

I have copied /etc/samba/* to the new machine (stone), and wasn't getting user authentication until I did smbpasswd -a user1 this allowed user1 to authenticate from a third, Windows Server 2008, machine however browsing to the users home directory results in a permission denied error. ( Since it probably should be clarified; when connecting to the wood Samba server from the same Server 2008 machine, user home directory is not blocked ).

I can't figure out if the error lies with Samba configuration or LDAP? My question is if coping /etc/samba is sufficient to transfer samba configuration - clearly it doesn't transfer user information.

UPDATE: I started the question before realizing smbpasswd created the new user with a next in line user id ... which didn't match up with the home directory file permissions ... so my question is really how can I transfer all the users from wood to stone and maintain their original passwd/id ? or even just id?

UPDATE 2: I used pdbedit to export/import the users, as was suggested. I get a different error now from the Windows side explaining it couldn't authenticate and that multiple connections with the same users aren't allowed. I stopped the samba service on wood, and did a restart on stone.

Daniel
  • 295
  • 2
  • 13

1 Answers1

1

First export your users to a file on wood -

pdbedit -e smbpasswd:/tmp/sambausers.bak

Then import users to to stone -

pdbedit -i smbpasswd:/tmp/sambauses.bak

Daniel t.
  • 9,291
  • 1
  • 33
  • 36
  • I'm updating the question ... I ran this sequence of commands, and get a different error. – Daniel Mar 16 '15 at 21:28
  • I wonder if this could be related to SIDs not being migrated correctly, even though the resource being connected is the Linux home directory? – Daniel Mar 16 '15 at 21:32
  • Do you see any files in /var/lib/samba/ ? I use Samba in Ubuntu and it stores the passwords in there. You might need to migrate those files as well. – Daniel t. Mar 16 '15 at 21:40
  • I did see the secrets.tdb and passwd.tdb or some such - I removed them, and pdbedit -i re-imported them I'm guessing because the file was re-created. – Daniel Mar 16 '15 at 22:24