linux初级学习之ladp网络帐号2-8

第八单元
LDAP 网络用户账户
学习目标
• LDAP 客户端配置
• 自动挂载器元字符
使用 LDAP 服务器进行网络身份验证
在多个系统上将本地用户账户协调一致非常困难本节中 , 我们将介绍如何将计算机设置为客户端 , 以使用现有 LDAP 目录服务提供的网络用户账户。这样 , LDAP 目录就成为我们组织中所有网络用户和组的中心机构用户账户信息可以确定装户的特征和配置。身份验证方式用于确定尝试登录的人员是否应该获得对账户的使用权限。网络目录服务可以提供用户账户信息和身份验证方法LDAP 目录服务器可以用作分布式、集中式、网络用户管理服务。目录条目按树结构排列 , 可以在其中进行搜索。基础 DN ( 区分名称 ) 是树的基础 , 用于搜索用户和组的目录条目
LDAP 客户端配置的主要元素
– 1. 服务器的完全限定主机名
– 2. 基础 DN , 用于搜索用户定义
– 3. 认证机构 (“ CA” ) 证书 , 用于签署 LDAP 服务器的 SSL 证书
安装客户端软件
• authconfig-gtk
• sssd
• krb5-workstation
[root@localhost mnt]# yum install  sssd krb5-workstation  authconfig-gtk -y

通过 authconfig-gtk 认证 ldap 用户
• authconfig-gtk
检测 ldap 认证用户
• getent passwd ldapuserx
• vim /etc/sssd.conf
– enumerate = ture | false
– systemctl restart sssd
通过 authconfig-tui 认证 ldap 用户
• authconfig-tui

[root@localhost mnt]# authconfig-tui




用脚本实现认证
[root@localhost mnt]# vim auth-config.sh
#!/bin/bash
echo "install packages..."
yum install sssd krb5-workstation autofs -y &>  /dev/null
echo "config authconfig..."
authconfig \
--enableldap \
--enablekrb5 \
--disableldapauth \
--enableldaptls \
--ldapserver="classroom.example.com" \
--ldapbasedn="dc=example,dc=com" \
--ldaploadcacert=http://172.25.254.254/pub/example-ca.crt \
--krb5realm="EXAMPLE.COM" \
--krb5kdc="classroom.example.com" \
--krb5adminserver="classroom.example.com" \
--update
echo "config autofs..."
echo "/home/guests  /etc/auto.ldap" >>/etc/auto.master
echo "*  172.25.254.254:/home/guests/&" >>/etc/auto.ldap
systemctl  restart  autofs

echo "ok !!"



[root@localhost mnt]# sh auth-config.sh





下载证书文件
• cd /etc/openldap/cacerts
• wget http://classroom.example.com/pub/example-ca.crt
• ls /etc/openldap/cacerts

[root@localhost mnt]# wget http:/172.25.254.254/pub/example-ca.crt ##下载证书文件


自动挂在 ldap 用户家目录
• 安装 autofs
• 编辑 autofs 策略文件

[root@localhost mnt]# yum install autofs -y



– vim /etc/autos.master
/home/guests /etc/auto.ldap
– vim /etc/auto.ldap
ldapuser0   classroom.example.com:/home/guests/ldapuser0

[root@localhost mnt]# vim /etc/autofs.master  ##在配置文件中写入/home/guests /etc/auto.ldap



[root@localhost mnt]# vim /etc/auto.ldap     ##在配置文件写入*   172.25.66.254:/home/guests/& 自动挂在 ldap 用户家目录









  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值