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

  • 相关阅读:
    C# WPF 窗体传递消息
    WPF ProgressBar 样式
    WPF的TextBox以及PasswordBox显示水印文字
    Win8.1 Hyper-V 共享本机IP上网
    ASP.NET MVC入门-Startup 类:注册服务和使用中间件
    ASP.NET MVC入门-Program类:程序的入口
    Unity3d AssetBundle 资源加载与管理
    C#考核知识点总结
    数据结构与算法之美-字符串匹配(上)
    LeetCode-探索链表-综合问题
  • 原文地址:https://www.cnblogs.com/linuxbo/p/4289366.html
Copyright © 2011-2022 走看看