Migrating Samba Users

YuriiV

Cadet
Joined
Jan 7, 2022
Messages
9
Hello, data replication is currently configured from the main server to the backup. Transferred Unix users from the main server by editing the backup DB file (I imported three tables account_bsdgroupmembership, account_bsdgroups, account_bsdusers). But with Samba problems, tried after transferring Unix users, deleted the file /var/db/system/samba4/private/passdb.tdb and then re-syncing the users: `midclt call smb.synchronize_passdb -job`. But problems with authorization and access to network drives were not resolved. Is there any way to correctly migrate samba users?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
Hello, data replication is currently configured from the main server to the backup. Transferred Unix users from the main server by editing the backup DB file (I imported three tables account_bsdgroupmembership, account_bsdgroups, account_bsdusers). But with Samba problems, tried after transferring Unix users, deleted the file /var/db/system/samba4/private/passdb.tdb and then re-syncing the users: `midclt call smb.synchronize_passdb -job`. But problems with authorization and access to network drives were not resolved. Is there any way to correctly migrate samba users?
The NT hashes in the account_bsdusers table are encrypted with a key stored on the main server. This means you need to decrypt the entry with key from other server re-encrypt with new key, then write the entry (if you're planning to do manual DB editing from shell). In general such things aren't advisable.

Perhaps look into using the websocket API to read the values from the main server, and then duplicate the users / groups on the remote one.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
Top