通过web界面修改samba密码<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
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
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
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]#
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]#
容易出现的问题:
1
、
make: *** [changepassword.cgi] Error 1
配置中仔细查看
./configure
是否有误。
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";
char TMPSMBFILE[]="/changepw/changepassword-smb-XXXXXX";
char TMPSQUIDFILE[]="/changepw/changepassword-squid-XXXXXX";
这个目录
changepw
是手动创建的最好与
/tmp
权限一样。
让
SAMBA
用户不能登陆
LINUX
系统
:
建帐号时 :useradd –s /sbin/nologin frank 即可了 ……
建帐号时 :useradd –s /sbin/nologin frank 即可了 ……
或修改
: vi /etc/passwd
把相应的帐号
,,
改为
/sbin/nologin
就行了
….
转载于:https://blog.51cto.com/frankzhao/238957