Menu Close
第 9 章 设置信任
本节描述了如何使用命令行在 IdM 端上配置身份管理(IdM)/Active Directory(AD)信任。
先决条件
- 正确配置了 DNS。IdM 和 AD 服务器必须能够解析其他名称。详情请参阅为信任配置 DNS 和领域设置。
- 部署了 AD 和 IdM 的支持版本。详情请查看 支持的 Windows Server 版本。
- 您已获得 Kerberos ticket。详情请参阅 使用 kinit 手动登录到 IdM 。
9.1. 为信任准备 IdM 服务器
在与 AD 建立信任前,您必须在 IdM 服务器上使用 ipa-adtrust-install
工具来准备 IdM 域。
在其上运行 ipa-adtrust-install
命令的所有系统都会自动成为 AD 信任控制器。但是,您必须在 IdM 服务器上只运行一次 ipa-adtrust-install
。
先决条件
- IdM 服务器已安装。
- 您需要 root 权限才能安装软件包并重新启动 IdM 服务。
步骤
安装所需的软件包:
[root@ipaserver ~]# dnf install ipa-server-trust-ad samba-client
以 IdM 管理用户身份进行身份验证:
[root@ipaserver ~]# kinit admin
运行
ipa-adtrust-install
工具:[root@ipaserver ~]# ipa-adtrust-install
如果 IdM 安装了集成的 DNS 服务器,则会自动创建 DNS 服务记录。
如果您在没有集成 DNS 服务器的情况下安装了 IdM,
ipa-adtrust-install
会打印一个服务记录列表,您必须手动将它们添加到 DNS ,然后才能继续操作。该脚本提示您
/etc/samba/smb.conf
已存在,并将被重写:WARNING: The smb.conf already exists. Running ipa-adtrust-install will break your existing Samba configuration. Do you wish to continue? [no]:
yes
该脚本提示您配置
slapi-nis
插件,这是一个兼容插件,允许旧的 Linux 客户端与受信任的用户一起工作:Do you want to enable support for trusted domains in Schema Compatibility plugin? This will allow clients older than SSSD 1.9 and non-Linux clients to work with trusted users. Enable trusted domains support in slapi-nis? [no]:
yes
提示时,输入 IdM 域的 NetBIOS 名称,或者按 Enter 接受推荐的名称:
Trust is configured but no NetBIOS domain name found, setting it now. Enter the NetBIOS name for the IPA domain. Only up to 15 uppercase ASCII letters, digits and dashes are allowed. Example: EXAMPLE. NetBIOS domain name [IDM]:
系统会提示您运行 SID 生成任务,以便为任何现有用户创建 SID:
Do you want to run the ipa-sidgen task? [no]:
yes
这是一个资源密集型任务,因此如果您有大量的用户,您可以在其他时间运行此操作。
(可选) 默认情况下,对于 Windows Server 2008 及更高版本,动态 RPC 端口范围定义为
49152-65535
。如果需要为您的环境定义一个不同的动态 RPC 端口范围,请将 Samba 配置为使用不同的端口,并在防火墙设置中开放这些端口。以下示例将端口范围设置为55000-65000
。[root@ipaserver ~]# net conf setparm global 'rpc server dynamic port range' 55000-65000 [root@ipaserver ~]# firewall-cmd --add-port=55000-65000/tcp [root@ipaserver ~]# firewall-cmd --runtime-to-permanent
确保正确配置了DNS,如 验证信任的 DNS 配置 中所述。
重要红帽强烈建议您在每次运行完
ipa-adtrust-install
后,验证 DNS 配置,如 验证信任的 DNS 配置 中所述,特别是如果 IdM 或 AD 不使用集成的 DNS 服务器。重启
ipa
服务:[root@ipaserver ~]# ipactl restart
使用
smbclient
工具来验证 Samba 是否会对 IdM 端的 Kerberos 身份验证做出响应:[root@ipaserver ~]#
smbclient -L server.idm.example.com -U user_name --use-kerberos=required
lp_load_ex: changing to config backend registry Sharename Type Comment --------- ---- ------- IPC$ IPC IPC Service (Samba 4.15.2) ...