
# 配置ldap客户端
1. 在目标主机安装ldap客户端
   ```
   yum install -y nss-pam-ldapd openldap-clients
   ```
   
2. 配置系统文件
   ```
   /bin/cp -f /tmp/packer/config/ldap/centos/nslcd.conf /etc/nslcd.conf
   /bin/cp -f /tmp/packer/config/ldap/centos/nsswitch.conf /etc/nsswitch.conf
   /bin/cp -f /tmp/packer/config/ldap/centos/authconfig /etc/sysconfig/authconfig
   /bin/cp -f /tmp/packer/config/ldap/centos/password-auth /etc/pam.d/password-auth
   /bin/cp -f /tmp/packer/config/ldap/centos/system-auth /etc/pam.d/system-auth
   ```
   
3. 配置客户端连接配置nslcd.conf
   ```
   vi /etc/nslcd.conf
   ```
   
4. 启动客户端服务
   ```
   sudo chmod 600 /etc/nslcd.conf
   sudo systemctl disable nslcd
   ```
   
5. 查看部署状态
   ```
   docker service ls
   ```
   图1查看部署状态   
   ![](https://support.huaweicloud.com/tsficds-mnft/zh-cn_image_0000001477852508.png) 
 
