Change samba account password using changepassword in CentOS 6.3

Source: Internet
Author: User

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.

  • 1
  • 2
  • Next Page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.