1.6.3. 在 IdM 客户端中安装和配置 Samba 服务器


您可以在 IdM 客户端上安装和配置 Samba,以安全地共享具有集成身份验证的文件。这利用 IdM 域帐户来访问。确保适当的先决条件和配置,以便在您的网络上启用无缝资源共享。

先决条件

流程

  1. 安装ipa-client-samba软件包:

    [root@idm_client]# dnf install ipa-client-samba
  2. 使用ipa-client-samba工具准备客户端并创建初始 Samba 配置:

    [root@idm_client]# ipa-client-samba
    Searching for IPA server...
    IPA server: DNS discovery
    Chosen IPA master: idm_server.idm.example.com
    SMB principal to be created: cifs/idm_client.idm.example.com@IDM.EXAMPLE.COM
    NetBIOS name to be used: IDM_CLIENT
    Discovered domains to use:
    
     Domain name: idm.example.com
    NetBIOS name: IDM
             SID: S-1-5-21-525930803-952335037-206501584
        ID range: 212000000 - 212199999
    
     Domain name: ad.example.com
    NetBIOS name: AD
             SID: None
        ID range: 1918400000 - 1918599999
    
    Continue to configure the system with these values? [no]: yes
    Samba domain member is configured. Please check configuration at /etc/samba/smb.conf and start smb and winbind services
  3. 默认情况下,ipa-client-samba 会自动将 [homes] 部分添加到 /etc/samba/smb.conf 文件中。本节在用户连接时动态共享用户的主目录。如果用户在这个服务器上没有主目录,或者您不想共享主目录,请从 /etc/samba/smb.conf 中删除它们:

    [homes]
        read only = no
  4. 共享目录和打印机。详情请查看:

  5. 在本地防火墙中打开 Samba 客户端所需的端口:

    [root@idm_client]# firewall-cmd --permanent --add-service=samba-client
    [root@idm_client]# firewall-cmd --reload
  6. 启用并启动smbwinbind服务:

    [root@idm_client]# systemctl enable --now smb winbind
    注意

    不要启动 nmbd 服务。当将 Samba 与 Active Directory 搭配使用时,互操作性不需要 NetBIOS - DNS 在 AD 环境中处理名称解析。

验证

  • 对安装了 samba-client 软件包的不同 IdM 域成员运行以下验证步骤:

    • 使用 Kerberos 身份验证列出 Samba 服务器中的共享:

      $ smbclient -L idm_client.idm.example.com -U user_name --use-kerberos=required
      lp_load_ex: changing to config backend registry
      
          Sharename       Type      Comment
          ---------       ----      -------
          example         Disk
          IPC$            IPC       IPC Service (Samba 4.15.2)
      ...

      如需更多信息,请参阅您系统上的 ipa-client-samba (1) 手册页。

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部