Recently has been studying the Linux shell, so long time no update. Today is also in QQ someone and I talk to the Samba password LDAP centralized authentication, think of a problem, the intranet use Samba server to store user data, all users can not log into the Linux background, how to allow customers to modify their passwords?
To resolve the implementation of the client to modify the samba password, in fact, do not need to build LDAP (maintenance costs are high), also do not need to use administrative methods to statistics client password (after all, colleagues are embarrassed to tell you he usually used the password), online Google, Using the ChangePassword tool, you can use its web interface to allow ordinary users to log on to the Web to modify their passwords, greatly improving work efficiency.
Samba:centos default Yum Source
changepassword:changepassword-0.9
apache:httpd-2.4.4
I. Environment:
1. Before configuring the iptables and SELinux, avoid the error in the configuration process.
# Service Iptables Stop
# Setenforce 0
# Vi/etc/sysconfig/selinux
---------------
Selinux=disabled
---------------
2. Install the development package
# yum Install Gcc-y
3. Install Apache
Transmission door: http://showerlee.blog.51cto.com/2047005/1174141
Two. Configure Samba:
1. Install Samba:
# yum Install Samba-y
2. Configure Samba:
To implement a client change password using the ChangePassword program, you must set the system password and Samba password synchronization
# vi/etc/samba/smb.conf
Search Security = User then add the following and comment passdb backend = Tdbsam
----------------
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
Passdb backend = smbpasswd
SMB passwd file =/etc/samba/smbpasswd
# Passdb backend = Tdbsam
--------------------------
Note: The above changes in fact will be TDBSAM authentication mode to modify the SMBPASSWD, and the authentication file encryption saved under/ETC/SAMBA/SMBPASSWD
Restart Service:
# Service SMB Restart
Create Samba account (Close user shell interface)
# useradd-s/sbin/nologin User01
# passwd User01
# smbpasswd-a User01
Note: You must set up the system account password and the SMB account password when creating the Samba account here
Because ChangePassword changes the password mechanism, first modifies the system account password, then synchronizes the system account password to the/ETC/SAMBA/SMBPASSWD SMB password library file.
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/