Red Hat Training

A Red Hat training course is available for RHEL 8

第 108 章 在 IdM 域成员中设置 Samba

您可以在加入到 Red Hat Identity Management (IdM)域的主机上设置 Samba。来自IdM的用户,以及来自受信任的 Active Directory(AD)域的用户(如果有的话)可以访问 Samba 提供的共享和打印机服务。

重要

对 IdM 域成员使用 Samba 是一种不受支持的技术预览特性,且包含了某些限制。例如,IdM 信任控制器不支持 Active Directory 全局目录服务,它们不支持使用分布式计算环境/远程过程调用(DCE/RPC)协议解析 IdM 组。因此,AD 用户只能在登录到其他 IdM 客户端时访问托管在 IdM 客户端中的 Samba 共享和打印机 ; 登录到 Windows 机器的 AD 用户无法访问托管在 IdM 域成员中的 Samba 共享。

我们鼓励在 IdM 域成员中部署 Samba 的用户向红帽提供反馈意见。

如果 AD 域中的用户需要访问 Samba 提供的共享和打印机服务,请确保在 AD 中启用了 AES 加密类型。如需更多信息,请参阅 使用 GPO 在活动目录中启用 AES 加密类型

先决条件

  • 主机作为 IdM 域的客户端加入。
  • IdM 服务器和客户端必须在 RHEL 8.1 或更高版本中运行。

108.1. 准备 IdM 域以便在域成员中安装 Samba

在IdM客户端上设置Samba之前,必须在IdM服务器上使用ipa-adtrust-install工具来准备IdM域。

注意

运行ipa-adtrust-install命令的任何系统都会自动成为 AD 信任控制器。但是,您必须在 IdM 服务器上只运行一次 ipa-adtrust-install

先决条件

  • IdM 服务器已安装。
  • 您需要 root 权限才能安装软件包并重新启动 IdM 服务。

流程

  1. 安装所需的软件包:

    [root@ipaserver ~]# yum install ipa-server-trust-ad samba-client
  2. 以 IdM 管理用户身份进行身份验证:

    [root@ipaserver ~]# kinit admin
  3. 运行 ipa-adtrust-install 工具:

    [root@ipaserver ~]# ipa-adtrust-install

    如果 IdM 安装了集成的 DNS 服务器,则会自动创建 DNS 服务记录。

    如果您在没有集成 DNS 服务器的情况下安装了 IdM,ipa-adtrust-install 会打印一个服务记录列表,您必须手动将它们添加到 DNS ,然后才能继续操作。

  4. 该脚本提示您 /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
  5. 该脚本提示您配置 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
  6. 提示时,输入 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]:
  7. 系统会提示您运行 SID 生成任务,以便为任何现有用户创建 SID:

    Do you want to run the ipa-sidgen task? [no]: yes

    这是一个资源密集型任务,因此如果您有大量的用户,您可以在其他时间运行此操作。

  8. (可选) 默认情况下,对于 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
  9. 重启ipa服务:

    [root@ipaserver ~]# ipactl restart
  10. 使用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)
    ...