Migrating authentication of Samba from SMBPASSWD to TDB

Source: Internet
Author: User

Was addicted various after you upgrade the OS of an old Samba server. Put It also was using a set of 2.x era become 3.x are seems to the have emerged.

Changes in 3.x

Format and location of the password file have been modified in 3.x.

/etc/smbpasswd /var/lib/samba/passdb.tdb

Also pdbedit command is provided for the administrator. And though it must have administrator privileges, and powerful general-purpose, than SMBPASSWD.

Check the setting

By extracting a set of smb.conf in Testparm command to confirm that the Tdbsam are specified in the authentication DB.

% testparm -s /etc/samba/smb.conf ... passdb backend = tdbsam ... %
I make Passdb.tdb from the old smbpasswd file

Copy Smbpasswd.bak to work for in The/etc and/var/backups.

% sudo cp /etc/smbpasswd.bak /var/lib/samba/smbpasswd.txt

I to convert Pdbedit.

% sudo pdbedit -i smbpasswd:/var/lib/samba/smbpasswd.txt \ -e tdbsam:/var/lib/samba/smbpasswd.tdb

Retry fix the problem and get an error. This is simply remove the bad line.

% sudo vi /var/lib/samba/smbpasswd.txt (remove invalid users) % sudo rm /var/lib/samba/smbpasswd.tdb (try again)

I Replace the password file.

% sudo /etc/init.d/samba stop % sudo mv /var/lib/samba/passdb.tdb{,.bak} % sudo mv /var/lib/samba/{smbpasswd,passdb}.tdb % sudo /etc/init.d/samba restart

To test if you can logon.

% smbclient --debuglevel=3 //192.168.0.x/jdoe -U jdoe (jdoe‘s smb password) smb: \> exit %
Troubleshooting

Really sure the user is registered.

% sudo pdbedit -u jdoe -v

To register it if it's not registered.

% sudo pdbedit -a -u jdoe
Reference

It:whole Picture Revised version of Samba 3.0 [Part II] (3/3)/Takahashi Motonobu support of a variety of authentication Database
Http://www.atmarkit.co.jp/flinux/special/samba3b/samba06.html

Migrating authentication of Samba from SMBPASSWD to TDB

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.