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

  • 相关阅读:
    php 将英文引号成对转换为中文引号
    centos 6.2 x86_64 编译安装 httpd2.4.2时,apr报错
    PHP在通过非HTTP方式或多客户端的情况下,session的共享
    用c链接mysql
    多进程和多线程有什么区别
    进程和线程的区别
    linux中重要数据声明
    春节后返校第三天
    窗外下着雨——来到南京的第一篇
    中断门与陷阱门的区别
  • 原文地址:https://www.cnblogs.com/linuxbo/p/4289366.html
Copyright © 2011-2022 走看看