***************************

***********ldap************

***************************

1.ldap是什么

ldap目录服务认证,和windows活动目录类似,就是记录数据的一种方式

2.ldap客户端所需软件

yum install sssd krb5-workstation -y

3.如何开启ldap用户认证

authconfig-tui

┌────────────────┤ Authentication Configuration ├─────────────────┐

│                                                                 │

│  User Information        Authentication                         │

│  [ ] Cache Information   [ ] Use MD5 Passwords                  │

│  [*] Use LDAP            [*] Use Shadow Passwords               │

│  [ ] Use NIS             [ ] Use LDAP Authentication            │

│  [ ] Use IPAv2           [*] Use Kerberos                       │

│  [ ] Use Winbind         [ ] Use Fingerprint reader             │

│                          [ ] Use Winbind Authentication         │

│                          [*] Local authorization is sufficient  │

│                                                                 │

│            ┌────────┐                      ┌──────┐             │

│            │ Cancel │                      │ Next │             │

│            └────────┘                      └──────┘             │

│                                                                 │

│                                                                 │

└─────────────────────────────────────────────────────────────────┘

┌─────────────────┤ LDAP Settings ├─────────────────┐

│                                                   │

│          [*] Use TLS                              │

│  Server: ldap://cla***oom.example.com/___________ │

│ Base DN: dc=example,dc=com_______________________ │

│                                                   │

│         ┌──────┐                ┌──────┐          │

│         │ Back │                │ Next │          │

│         └──────┘                └──────┘          │

│                                                   │

│                                                   │

└───────────────────────────────────────────────────┘

┌─────────────────┤ Kerberos Settings ├──────────────────┐

│                                                        │

│        Realm: EXAMPLE.COM_____________________________ │

│          KDC: cla***oom.example.com___________________ │

│ Admin Server: cla***oom.example.com___________________ │

│               [ ] Use DNS to resolve hosts to realms   │

│               [ ] Use DNS to locate KDCs for realms    │

│                                                        │

│          ┌──────┐                    ┌────┐            │

│          │ Back │                    │ Ok │            │

│          └──────┘                    └────┘            │

│                                                        │

│                                                        │

└────────────────────────────────────────────────────────┘

【补图】

如果有提示证书文件缺失的话,是因为tls的证书缺失,需要到服务器端下载所需要的证书到/etc/openldap/cacerts,

用到的命令

wget http://172.25.254.254/pub/example-ca.crt

<测试>

getent passwd ldapuser1

如果用户信息可以正常显示,证明客户端认证成功。

列出所有用户

vim /etc/sssd/sssd.conf

enumerate = True

4.自动挂载用户家目录

yum install autofs -y

vim /etc/auto.master

/home/guests/etc/auto.ldap

vim /etc/auto.ldap

ldapuser1172.25.254.254:/home/guests/ldapuser1

————————————————————————————————————————————————————————

*172.25.254.254:/home/guests/&

systemctl restart autofs

systemctl enable autofs

5.【在新的机子上执行脚本获得上述所有功能,脚本如下】

#!/bin/bash

echo "install software ing ..."

yum install sssd krb5-workstation autofs -y &>/dev/null

echo "config ldap auth client ing ..."

authconfig \

--enableldap \

--enablekrb5 \

--disableldapauth \

--enableldaptls \

--ldaploadcacert=http://172.25.254.254/pub/example-ca.crt \

--ldapserver="cla***oom.example.com" \

--ldapbasedn="dc=example,dc=com" \

--krb5realm="EXAMPLE.COM" \

--krb5kdc="cla***oom.example.com" \

--krb5adminserver="cla***oom.example.com" \

--enablesssd \

--enablesssdauth \

--update

echo "config ldap user\'s home dirctory ing ..."

echo /home/guests       /etc/auto.ldap >> /etc/auto.master

echo "*         172.25.254.254:/home/guests/&" >> /etc/auto.ldap

systemctl restart autofs

systemctl enable autofs &> /dev/null

echo " All is Successfully !!!"

*******查询authconfig命令内容*****

authconfig --help | less

转载于:https://blog.51cto.com/onehxl/1873701

【unit 8 】ldap相关推荐

  1. 【英语学习】【医学】Unit 09 The Respiratory System

    [英语学习][医学]Unit 09 The Respiratory System <基础医学英语>读书笔记 文章目录 常见词根/词缀与词源 常见词根/词缀与词源 词根/词缀 含义 示例 词 ...

  2. linux程序网络验证,【redhat5.5】linux的LDAP认证服务器的配置及客户端pam网络验证实例...

    [1] LDAP简介 LDAP(Lightweight Directory Access Protocol) 代表轻量级目录访问协议 LDAP 是一种非关系型数据库 LDAP 可扩展性和灵活性良好 安 ...

  3. 【翻译搬运】协调多个运动单元的移动 Coordinated Unit Movement【一】

    Coordinated Unit Movement by Dave Pottinger 原文地址:https://www.gamasutra.com/view/feature/131720/coord ...

  4. 【自然语言处理】【多模态】UniT:基于统一Transformer的多模态多任务学习

    UniT:基于统一Transformer的多模态多任务学习 <UniT:Multimodal Multitask Learning with a Unified Transformer> ...

  5. 【翻译搬运】协调多个运动单元的移动 Coordinated Unit Movement【二】

    Coordinated Unit Movement by Dave Pottinger 原文地址:https://www.gamasutra.com/view/feature/131720/coord ...

  6. 本地部署SpringBootInitializr 【最新版】

    本地部署SpringBootInitializr [最新版] 几十年没写东西了,今天记录一个折腾 SpringBootInitializr 这东西不用介绍了, 在这里,git在这里 如果用IDEA或者 ...

  7. 【学神-RHEL7】1-4-1-Linux文件管理和恢复误删除的文件

      Linux基本文件管理 本节所讲内容: Linux系统目录结构 相对/绝对路径 创建/复制/删除文件 rm -rf / 意外事故 查看文件内容 xfs文件系统的备份和恢复 extundelete恢 ...

  8. 【高并发】高并发分布式锁架构解密,不是所有的锁都是分布式锁!!

    来自:冰河技术 写在前面 最近,很多小伙伴留言说,在学习高并发编程时,不太明白分布式锁是用来解决什么问题的,还有不少小伙伴甚至连分布式锁是什么都不太明白.明明在生产环境上使用了自己开发的分布式锁,为什 ...

  9. 【SAP技术】SAP不能修改一个已经分配给交货单的HU

    [SAP技术]SAP不能修改一个已经分配给交货单的HU 如下图的HU 190340203292,试图在HUMO里修改它, 系统切换到交货单修改界面,如下图: 看这个DN的HU list,该HU在列, ...

最新文章

  1. 如何连接本地mysql+设置无密码登录
  2. DFA确定性有穷自动机及其化简
  3. java mysql安装教_大学java教案之MySQL安装图解
  4. 服务器运行程序 网络错误怎么办,网站出现:ldquo;/rdquo;应用程序中的服务器错误。该如何解决?_已解决 - 阿里巴巴生意经...
  5. C#中实现byte[]与任意对象互换(服务端通讯专用)
  6. [转载] python数字类型(一)
  7. M文件---脚本与函数
  8. ajax存储表单数据,使用ajax json将表单数据存储到数据库php
  9. vant使用iconfont图标
  10. Android中动态调整ImageView的宽高比
  11. 利用阿里云oss实现上传视频和图片功能
  12. 9.SpringCloud Gateway网关
  13. 吴莫愁公布恋情爱上哈林 演唱会庾澄庆单膝跪地似求婚
  14. 3月12日公开短线黑马牛股请点击验证
  15. 人工智能与复杂网络_为什么我与智能手机的关系变得复杂
  16. 阿里研究员吴翰清:世界需要什么样的智能系统
  17. SpreadJS 纯前端表格控件应用案例:在线问卷系统
  18. presto获取上月第一天和最后一天、当月第一天
  19. C语言基础知识入门和C语言入门基础知识大全
  20. xshell 免费版申请

热门文章

  1. 数据类型与字节(字符)
  2. EnjoyToShare | 考研资料分享群
  3. Windows与macOS水火不容?有了它一切搞定
  4. 国际惯例,个人流程分享
  5. 小米4c,5s 红米note4x 刷 Lineage OS
  6. CMT2119/2119A 示例代码及说明
  7. 《无响应,是否重启人生?》程序人生征文结果
  8. Python pandas 分层抽样 超简洁
  9. 7-9 小于m的最大的10个素数 (15 分)
  10. 【9122】谈装修:项目与项目群