I have been researching linux shell recently, so I haven't updated it for a long time. Today, when someone talked to me on QQ about samba password ldap centralized authentication, I thought of a problem. The samba server is used to store user data in the Intranet, and all users cannot log on to the LINUX background, how can customers modify their own passwords?
To solve the problem of changing the samba password on the client, you do not need to set up ldap (high maintenance costs ), you do not need to use administrative techniques to calculate the client password (after all, my colleague is also embarrassed to tell you the password he is used, the changepassword tool allows common users to log on to the WEB to change their passwords, greatly improving work efficiency.
SAMBA: CentOS default yum Source
CHANGEPASSWORD: changepassword-0.9
APACHE: httpd-2.4.4
I. Environment Construction:
1. Disable iptables and SELINUX before configuration to avoid errors during configuration.
# Service iptables stop
# Setenforce 0
# Vi/etc/sysconfig/selinux
---------------
SELINUX = disabled
---------------
2. Install the SDK
# Yum install gcc-y
3. install apache
Portal:
2. Configure samba:
1. Install samba:
# Yum install samba-y
2. Configure samba:
To use the changepassword program, the system password and samba password must be set for the client to change the password.
# Vi/etc/samba/smb. conf
Search for security = user to add the following content (the default line of content is commented here)
----------------
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
--------------------------
# Service smb restart
Note: The above modification actually changes the tdbsam authentication method to smbpasswd, and stores the authentication file encrypted under/etc/samba/smbpasswd.
Create an smb account
# Useradd-s/sbin/nologin test04
# Passwd test04
# Smbpasswd-a test04
Note: When creating a samba account, you must set the system account password and smb account password.
Because changepassword is used to change the password, first change the system account password and then synchronize the system account password to the/etc/samba/smbpasswd SMB password library file.