通过web界面修改samba密码
samba 配置
vi  /etc/samba/smb.conf
配置文件内容
[global]
        workgroup = workgroup
        server string = Bang File Server    
        display charset = UTF8
        dos charset = cp950
        unix charset = gb2312
        netbios name = bangfileserver
        hosts allow = 127. 192.168.0. 192.168.6.
        log file = /var/log/samba/%m.log
        max log size = 500
        smb passwd file = /etc/samba/smbpasswd
        security = user
       
pam password change = no
        passwd chat = **NEW*UNIX*password* %n\n *Retype*new*UNIX*password* %n\n *successfully*
        passwd program = LANG=en_US /usr/bin/passwd %u
        unix password sync = yes
        load printers = yes
        cups options = raw
[homes]
        comment = Home Directories
        browseable = no
        writable = yes
[printers]
        comment = All Printers
        path = /var/spool/samba
        browseable = no
        guest ok = no
        writable = no
        printable = yes
 
三、要使用changepassword 程序实现,客户端更改密码必须设置系统密码和samba密码同步
        smb.conf文件中要有
        pam password change = no
        passwd chat = **NEW*UNIX*password* %n\n *Retype*new*UNIX*password* %n\n *successfully*
        passwd program = LANG=en_US /usr/bin/passwd %u
        unix password sync = yes
 
安装changepassword 其实很简单,网上也有高手写的中文文档,也可以直接看软件包中自带的README  文件。
 
基本是以下这样
 
1[root@test-samba changepassword-0.9]# ./configure --enable-cgidir=/var/www/cgi-bin --enable-language=Chinese --enable-smbpasswd=/etc/samba/smbpasswd --disable-squidpasswd --enable-logo=logo.jpg
 
smbpasswd 路径: smbpasswd=/etc/samba/smbpasswd 
logo.jpg  放到 /cgi-bin/changepassword.cgi/目录下:
2[root@test-samba changepassword-0.9]# make
 
3
[root@test-samba changepassword-0.9]# make install
cp changepassword.cgi /var/www/cgi-bin/changepassword.cgi
chmod 4755 /var/www/cgi-bin/changepassword.cgi
[root@test-samba changepassword-0.9]#
 
容易出现的问题:
1make: *** [changepassword.cgi] Error 1
配置中仔细查看./configure 是否有误。
 
2、在IE访问[url]http://192.168.6.143/cgi-bin/changepassword.cgi[/url]时,输入用户名和密码点击 change 出现下面的错误信息
Could not rename the temporary password file.
Please go back and try again.
 
你可以更改 conf.d文件中的
char TMPFILE[]="/changepw/changepassword-shadow-XXXXXX";
char TMPSMBFILE[]="/changepw/changepassword-smb-XXXXXX";
char TMPSQUIDFILE[]="/changepw/changepassword-squid-XXXXXX";
 
这个目录changepw是手动创建的最好与/tmp权限一样。
 
 
SAMBA 用户不能登陆LINUX 系统:
建帐号时:useradd –s /sbin/nologin  frank  即可了……
或修改:  vi /etc/passwd   把相应的帐号,,改为 /sbin/nologin   就行了….