码迷,mamicode.com
首页 > 数据库 > 详细

Migrating authentication of Samba from smbpasswd to tdb

时间:2015-02-13 00:15:04      阅读:169      评论:0      收藏:0      [点我收藏+]

标签:

Was addicted various After you upgrade the OS of old Samba server. Put it also was using a set of 2.x era become 3.x is seems to have emerged.

Changes in 3.x

Format and location of the standard password file has 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 is specified in the authentication DB.

 % testparm -s /etc/samba/smb.conf ... passdb backend = tdbsam ... % 

I make passdb.tdb from 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 time I was 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 is 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

标签:

原文地址:http://www.cnblogs.com/linuxbo/p/4289366.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!