Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a samba server and just installed the second one to configure a reserve file server.

It all went well and both of them successfully are on Active Directory domain (actually SAMBA 4)

the problem is that on the server 2 user shares messed with wrong uid/gids.

and if I id user1 on server 1 I get 2010 but but I run id user1 on server 2 I get 2031

They use 99% identical smb.conf

and they have: passdb backend = tdbsam

I have found out that in order to achieve equal UID/GID's I would need to use ldapsam but I don't know how to do it.

Do I need to first export from tdbsam and then install ldap server on server 1 export to that ldap server?

and then set passdb backend to ldapsam on both?

share|improve this question

You could export samba's users on the first server an import them on the next with pdbedit:

pdbedit -e tdbsam:/tmp/tdbsam.bak

and scp or rsync the file to the second server and on the second server:

pdbedit -i tdbsam:/tmp/tdbsam.bak

or import them from tdbsam (the local file) to ldapsam:

pdbedit -i tdbsam:/tmp/tdbsam.bak -e ldapsam:ldap://

Edit: I just saw this is an onl question... well if somebody still needs this.

share|improve this answer
Thank you for your answer. Almost one year have passed and I am going to test soon. Hopefully I will mark it as accepted. – bakytn Jan 26 '13 at 17:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.