linux基础2-8ldap网络用户账号

这篇博客介绍了如何在Linux上配置LDAP用户认证,包括安装ldap客户端软件,使用authconfig-tui开启认证,设置TLS证书,以及解决认证过程中遇到的问题。此外,还详细讲解了如何通过enumerate参数实现用户家目录的自动挂载。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

2.ldap客户端安装的软件
yum 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://classroom.example.com/_
│ Base DN: dc=example,dc=com_______________________ │
│ │
│ ┌──────┐ ┌──────┐ │
│ │ Back │ │ Next │ │
│ └──────┘ └──────┘ │
│ │
│ │
└───────────────────────────────────────────────────┘

┌─────────────────┤ Kerberos Settings ├──────────────────┐
│ │
│ Realm: EXAMPLE.COM_____________________________ │
│ KDC: classroom.example.com___________________ │
│ Admin Server: classroom.example.com___________________ │
│ [ ] Use DNS to resolve hosts to realms │
│ [ ] Use DNS to locate KDCs for realms │
│ │
│ ┌──────┐ ┌────┐ │
│ │ Back │ │ Ok │ │
│ └──────┘ └────┘ │
│ │
│ │
└────────────────────────────────────────────────────────┘
出现以下报错时:

┌────────────────┤ Warning ├─────────────────┐
│ │
│ To connect to a LDAP server with TLS │
│ protocol enabled you need a CA certificate │
│ which signed your server’s certificate. │
│ Copy the certificate in the PEM format to │
│ the ‘/etc/openldap/cacerts’ directory. │
│ Then press OK. │
│ │
│ ┌────┐ │
│ │ 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
systemctl restart sssd

4.自动挂载用户家目录
yum install autofs -y
vim /etc/autofs.master
/home/guests /etc/auto.ldap

vim /etc/auto.ldap
ldapuser1 172.25.254.254:/home/guests/ldapuser1

systemctl restart autofs
systemctl enable autofs

Guacamole-ldap 是 Apache Guacamole 项目中的一个认证扩展,它提供了 LDAP 认证的支持。使用 Guacamole-ldap,你可以将 Apache Guacamole 与你的 LDAP 目录集成,从而使用 LDAP 账户登录 Apache Guacamole。 要使用 Guacamole-ldap,你需要按照以下步骤进行设置: 1. 安装 Apache Guacamole。你可以从官方网站下载最新版本的 Apache Guacamole,或者使用你的 Linux 发行版的软件仓库进行安装。 2. 安装 Guacamole-ldap 扩展。你可以从官方网站下载最新版本的 Guacamole-ldap 扩展,或者使用你的 Linux 发行版的软件仓库进行安装。 3. 配置 Guacamole-ldap 扩展。你需要将 Guacamole-ldap 扩展的配置文件保存到 Guacamole 配置目录,然后根据你的 LDAP 目录进行配置。 4. 配置 Apache Guacamole。你需要将 Apache Guacamole 的配置文件保存到 Guacamole 配置目录,然后进行必要的配置,例如设置 Guacamole-ldap 扩展的认证方式。 安装 LDAP 账户需要进行以下步骤: 1. 安装 OpenLDAP 服务器。你可以从官方网站下载最新版本的 OpenLDAP,或者使用你的 Linux 发行版的软件仓库进行安装。 2. 创建 LDAP 用户和组。你可以使用 LDAP 管理工具,例如 Apache Directory Studio,创建 LDAP 用户和组。 3. 配置 LDAP 认证。你需要将 Apache Guacamole 的配置文件进行必要的配置,例如设置 LDAP 认证方式、LDAP 服务器地址、LDAP 用户和组的 DN 等。 4. 测试 LDAP 认证。你可以使用 Apache Guacamole 的登录页面进行测试,使用你的 LDAP 用户名和密码登录,确保认证成功。 希望这些信息能帮助到你。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值