zoukankan      html  css  js  c++  java
  • Migrating authentication of Samba from smbpasswd to tdb

    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

  • 相关阅读:
    封装
    面向对象的思想
    Arrays工具类
    二分查找
    选择排序
    冒泡排序
    对象数组
    二维数组
    一维数组
    循环语句注意事项
  • 原文地址:https://www.cnblogs.com/linuxbo/p/4289366.html
Copyright © 2011-2022 走看看