請使用下列程序整合 RHEL 8.x 桌面平台與 Active Directory (AD) 網域,以支援智慧卡重新導向。

此程序中的某些範例使用預留位置值來代表您網路組態中的實體,例如 AD 網域的 DNS 名稱。請將預留位置值取代為您的組態特有的資訊,如下表所說明。

預留位置值 說明
dns_IP_ADDRESS DNS 名稱伺服器的 IP 位址
rhel8sc.rzview2.com RHEL 8.0 系統的完整主機名稱
rhel8sc RHEL 8.0 系統的非完整主機名稱
rzview2.com AD 網域的 DNS 名稱
RZVIEW2.COM AD 網域的 DNS 名稱 (全部使用大寫字母)
RZVIEW2 包含 Samba 伺服器的工作群組或 NT 網域的 DNS 名稱 (全部使用大寫字母)
rzviewdns.rzview2.com AD 伺服器的主機名稱

程序

  1. 在 RHEL 8.x 系統上,執行以下操作。
    1. 根據組織要求設定網路和 DNS 設定。
    2. 停用 IPv6
    3. 停用自動 DNS
  2. 設定 /etc/hosts 組態檔,使其具有類似於下列範例的內容。
    127.0.0.1        rhel8sc.rzview2.com rhel8sc localhost localhost.localdomain localhost4 localhost4.localdomain4
    ::1              localhost localhost.localdomain localhost6 localhost6.localdomain6
     
    dns_IP_ADDRESS   rzviewdns.rzview2.com
  3. 設定 /etc/resolv.conf 組態檔,使其具有類似於下列範例的內容。
    # Generated by NetworkManager
    search rzview2.com
    nameserver dns_IP_ADDRESS
  4. 安裝 AD 整合所需的套件。
    # yum install -y samba-common-tools oddjob-mkhomedir
  5. 啟用 oddjobd 服務。
    # systemctl enable oddjobd.service
    # systemctl start oddjobd.service
    
  6. 指定系統身分和驗證來源。
    # authselect select sssd with-smartcard with-mkhomedir
    
    
  7. 啟動 oddjobd 服務。
    # systemctl enable oddjobd.service
    # systemctl start oddjobd.service
    
  8. 若要支援智慧卡驗證,請建立 /etc/sssd/sssd.conf 檔案。
    # touch /etc/sssd/sssd.conf
    # chmod 600 touch /etc/sssd/sssd.conf
    # chown root:root /etc/sssd/sssd.conf
  9. 將所需內容新增到 /etc/sssd/sssd.conf 中,如下列範例所示。在 [pam] 區段下方指定 pam_cert_auth = True
    [sssd]
    config_file_version = 2
    domains = rzview2.com
    services = nss, pam, pac
     
    [domain/RZVIEW2.COM]
    id_provider = ad
    auth_provider = ad
    chpass_provider = ad
    access_provider = ad
    cache_credentials = true
     
    [pam]
    pam_cert_auth = True
  10. 啟用 sssd 服務。
    # systemctl enable sssd.service
    # systemctl start sssd.service
  11. 編輯 /etc/krb5.conf 組態檔,使其具有類似於下列範例的內容。
    # To opt out of the system crypto-policies configuration of krb5, remove the
    # symlink at /etc/krb5.conf.d/crypto-policies which will not be recreated.
    includedir /etc/krb5.conf.d/
     
    [logging]
        default = FILE:/var/log/krb5libs.log
        kdc = FILE:/var/log/krb5kdc.log
        admin_server = FILE:/var/log/kadmind.log
     
    [libdefaults]
        dns_lookup_realm = false
        ticket_lifetime = 24h
        renew_lifetime = 7d
        forwardable = true
        rdns = false
        pkinit_anchors = /etc/pki/tls/certs/ca-bundle.crt
        spake_preauth_groups = edwards25519
        default_realm = RZVIEW2.COM
        default_ccache_name = KEYRING:persistent:%{uid}
     
    [realms]
     RZVIEW2.COM = {
         kdc = rzviewdns.rzview2.com
         admin_server = rzviewdns.rzview2.com
         default_domain = rzviewdns.rzview2.com
         pkinit_anchors = FILE:/etc/pki/nssdb/certificate.pem
         pkinit_cert_match = <KU>digitalSignature
         pkinit_kdc_hostname = rzviewdns.rzview2.com
     }
     
    [domain_realm]
     .rzview2.com = RZVIEW2.COM
     rzview2.com = RZVIEW2.COM
  12. 編輯 /etc/samba/smb.conf 組態檔,使其具有類似於下列範例的內容。
    [global]
            workgroup = RZVIEW2
            security = ads
            passdb backend = tdbsam
            printing = cups
            printcap name = cups
            load printers = yes
            cups options = raw
            password server = rzviewdns.rzview2.com
            realm = RZVIEW2.COM
            idmap config * : range = 16777216-33554431
            template homedir =/home/RZVIEW2/%U
            template shell = /bin/bash
            kerberos method = secrets and keytab
     
    [homes]
            comment = Home Directories
            valid users = %S, %D%w%S
            browseable = No
            read only = No
            inherit acls = Yes
     
    [printers]
            comment = All Printers
            path = /var/tmp
            printable = Yes
            create mask = 0600
            browseable = No
     
    [print$]
            comment = Printer Drivers
            path = /var/lib/samba/drivers
            write list = @printadmin root
            force group = @printadmin
            create mask = 0664
            directory mask = 0775
  13. 加入 AD 網域,如下列範例所示。
    # net ads join -U AdminUser
    執行 join 命令將傳回類似下列範例的輸出。
    Enter AdminUser's password:
    Using short domain name -- RZVIEW2
    Joined 'RHEL8SC' to dns domain 'rzview2.com'
  14. 確認 RHEL 8.x 桌面平台已成功加入 AD 網域。
    # net ads testjoin
    
    Join is OK

下一步

設定 RHEL 8.x 桌面平台的智慧卡重新導向