安装 Oracle® Solaris 11.2 系统

退出打印视图

更新时间: 2014 年 7 月
 
 

如何使用 AI 配置 Kerberos 客户机

在此过程中,客户机的密钥表文件已经创建好并存储在 AI 服务器上。示例中使用预先存在的凭证或使用新主体,进而使用自动注册来配置 Kerberos 客户机。自动注册过程较为简单,因为不必为各个客户机创建和编码密钥表文件。

  1. 成为管理员。

    有关更多信息,请参见How to Use Your Assigned Administrative Rights in Oracle Solaris 11.2 Administration: Security Services

  2. 根据需要创建安装服务。
    # installadm create-service -n krb-sparc \ 
        -d /export/auto_install/krb-sparc \ 
        -s /export/auto_install/iso/sol-11_2-ai-sparc.iso
    Creating service from:
    /export/auto_install/iso/sol-11_2-ai-sparc.iso 
    Setting up the image ... 
    Creating sparc service: krb-sparc 
    Image path: /export/auto_install/krb-sparc 
    Refreshing install services
      
  3. 将客户机与服务相关联。

    对需要在安装后运行 Kerberos 的所有客户机重复此步骤。在本示例中,使用地址 11:11:11:11:11:11 的客户机与 krb-sparc 安装服务关联。

    # installadm create-client -n krb-sparc -e 11:11:11:11:11:11
    Adding host entry for 11:11:11:11:11:11 to local DHCP configuration.
      
  4. 为客户机创建凭证。
    # installadm set-client -c 11:11:11:11:11:11 -g 
    Generating credentials for client 11:11:11:11:11:11... 
    A new certificate key has been generated. 
    A new certificate has been generated.
      
  5. 创建定义了 Kerberos 配置文件内容的系统配置文件。

    本示例通过以交互方式运行 kclient 命令来创建配置文件。或者,您也可以使用命令行选项或输入配置文件来调用该命令。有关更多信息,请参见 kclient(1M) 手册页。

    在本示例中,KDC 正在 MIT 服务器上运行。要查看 Solaris KDC 的样例输出,请参见Example 8–31。要查看 AD 客户机的样例输出,请参见Example 8–33

    # kclient -x /root/krb-sc.xml
    Starting client setup
    ---------------------------------------------------
    Is this a client of a non-Solaris KDC ? [y/n]: y
    Which type of KDC is the server: 
           ms_ad: Microsoft Active Directory 
           mit: MIT KDC server 
           heimdal: Heimdal KDC server 
           shishi: Shishi KDC server 
    Enter required KDC type: mit 
    Do you want to use DNS for kerberos lookups ? [y/n]: n 
           No action performed. 
    Enter the Kerberos realm: EXAMPLE.COM 
    Specify the master KDCs for the above realm using a comma-separated list: kdc.example.com 
    Do you have any slave KDC(s) ? [y/n]: y 
    Enter a comma-separated list of slave KDC host names: kdc2.example.com 
    Do you have multiple domains/hosts to map to a realm ? [y/n]: n
           No action performed.
    Setting up /root/krb-sc.xml.
  6. (u53ef选) 将客户机的二进制密钥表文件转换为 XML 配置文件。

    如果可通过自动注册获取密钥或客户机不具有密钥,则不需要执行此步骤。需要为客户机创建密钥表文件,如果首先配置了客户机,则此操作通常由 KDC 管理员执行。

    # kclient-kt2prof -k ./host1.keytab -p /root/host1.xml
      
  7. 创建客户机配置文件以完成该客户机的其余配置。

    由于此过程必须使用配置文件,因此请使用系统配置文件尽可能多地配置客户机的设置。

  8. (u53ef选) 为配置文件设置安全策略。

    如果客户机配置文件包含密钥表,则应将 require-client-auth 安全策略分配给服务,以便只有经过验证的客户机才能下载其密钥表文件。

    # installadm set-service -p require-client-auth -n krb-sparc
  9. 将客户机配置文件与客户机服务相关联。

    将 Kerberos 配置文件、客户机密钥表文件以及已创建的任何其他配置文件关联到安装服务。

    # installadm create-profile -n krb-sparc -f /root/krb-sc.xml 
    Profile krb-sc.xml added to database. 
    # installadm create-profile -n krb-sparc -f /root/host1.xml -c mac="11:11:11:11:11:11"
    Profile host1.xml added to database.
      
  10. 引导客户机以启动 AI 过程。
示例 8-31  在部署 Kerberos 客户机时下载现有密钥

请注意,仅当 KDC 为 Solaris KDC 或 MS AD 时,自动注册才能起作用。如果 KDC 为 MIT、Heimdal 或 Shishi,则仅能传输预先生成的密钥表。

要使用自动注册下载现有密钥,必须先使用 ci 管理特权在 KDC 上创建管理员主体。在本示例中,主体的名称为 download/admin。有关说明,请参见在 Oracle Solaris 11.2 中管理 Kerberos 和其他验证服务 中的创建新的 Kerberos 主体在 Oracle Solaris 11.2 中管理 Kerberos 和其他验证服务 中的修改主体的 Kerberos 管理特权

在本示例中,KDC 正在运行 Oracle Solaris。此外,客户机的密钥已创建。

本示例说明了如何在为 Kerberos 配置文件创建系统配置文件时添加 download/admin 主体。download/admin 主体是一个特殊的管理员主体,用于在部署 Kerberos 客户机时从 KDC 服务器传输现有密钥。

# kclient -x /root/krb-sc.xml	
Starting client setup 
--------------------------------------------------- 
Is this a client of a non-Solaris KDC ? [y/n]: n 
        No action performed. 
Do you want to use DNS for kerberos lookups ? [y/n]: n 
        No action performed. 
Enter the Kerberos realm: EXAMPLE.COM 
Specify the master KDCs for the above realm using a comma-separated
list: kdc.example.com 
Do you have any slave KDC(s) ? [y/n]: y 
Enter a comma-separated list of slave KDC host names: kdc2.example.com 
Do you have multiple domains/hosts to map to realm  ? EXAMPLE.COM [y/n]: n
        No action performed.
Should the client automatically join the realm ? [y/n]: y
Enter the krb5 administrative principal to be used: download/admin
Password for download/admin: xxxxxxxx
Do you plan on doing Kerberized nfs ? [y/n]: n 
        No action performed.   
Is this client a member of a cluster that uses a logical host name ? [y/n]: n
        No action performed. 
Do you have multiple DNS domains spanning the Kerberos realm EXAMPLE.COM ? [y/n]: n
        No action performed.
Setting up /root/krb-sc.xml.
示例 8-32  在部署 Kerberos 客户机时创建新密钥

请注意,仅当 KDC 为 Solaris KDC 或 MS AD 时,自动注册才能起作用。如果 KDC 为 MIT、Heimdal 或 Shishi,则仅能传输预先生成的密钥表。

要使用自动注册下载新密钥,必须先使用 aci 管理特权在 KDC 上创建管理员主体。在本示例中,主体的名称为 create/admin。有关说明,请参见在 Oracle Solaris 11.2 中管理 Kerberos 和其他验证服务 中的创建新的 Kerberos 主体在 Oracle Solaris 11.2 中管理 Kerberos 和其他验证服务 中的修改主体的 Kerberos 管理特权

在本示例中,KDC 正在运行 Oracle Solaris。本示例将在您为 Kerberos 配置文件创建系统配置文件时添加 create/admin 主体。create/admin 主体是一个特殊的管理员主体,用于在部署 Kerberos 客户机时从 KDC 服务器传输新密钥。此命令包含了更多的选项,因此询问的问题相应地减少了。

# kclient -x /root/krb-sc.xml -R EXAMPLE.COM -a create/admin -d none -m kdc.example.com	
Starting client setup 
--------------------------------------------------- 
Do you have multiple domains/hosts to map to realm  ? EXAMPLE.COM [y/n]: n
        No action performed.
Should the client automatically join the realm ? [y/n]: y
Password for create/admin: xxxxxxxx
Setting up /root/krb-sc.xml.
示例 8-33  自动将 AI 客户机加入到 MS AD 域

在本示例中,客户机将加入到某个 AD 域。使用以下命令可在您为 Kerberos 配置文件创建系统配置文件时添加 Adminstrator 主体。

# kclient -x /root/krb-sc.xml	
Starting client setup 
--------------------------------------------------- 
Is this a client of a non-Solaris KDC ? [y/n]: y 
Which type of KDC is the server: 
        ms_ad: Microsoft Active Directory 
        mit: MIT KDC server 
        heimdal: Heimdal KDC server 
        shishi: Shishi KDC server 
Enter required KDC type: ms_ad 
Should the client automatically join AD domain ? [y/n]: y
Enter the Kerberos realm: EXAMPLE.COM 
Enter the krb5 administrative principal to be used: Administrator
Password for Administrator: xxxxxxxx
Setting up /root/krb-sc.xml.