在 Oracle® Solaris 11.2 中管理 Kerberos 和其他验证服务

退出打印视图

更新时间: 2014 年 9 月
 
 

如何为 NIS 主机设置 Diffie-Hellman 密钥

在 NIS 域中的每个主机上执行此过程。

开始之前

您必须承担 root 角色。有关更多信息,请参见在 Oracle Solaris 11.2 中确保用户和进程的安全 中的使用所指定的管理权限

  1. 如果缺省命名服务不是 NIS,则将 publickey 映射添加到命名服务。
    1. 确认命名服务的 config/default 值不是 nis
      # svccfg -s name-service/switch listprop config
      config                       application
      config/value_authorization   astring       solaris.smf.value.name-service.switch
      config/default               astring       files
      config/host                  astring       "files nis dns"
      config/printer               astring       "user files nis"

      如果 config/default 值为 nis,您可以在此处停止。

    2. 将命名服务的 publickey 设置为 nis
      # svccfg -s name-service/switch setprop config/publickey = astring: "nis"
      # svccfg -s name-service/switch:default refresh
    3. 确认 publickey 值。
      # svccfg -s name-service/switch listprop
      config                       application
      config/value_authorization   astring       solaris.smf.value.name-service.switch
      config/default               astring       files
      config/host                  astring       "files nis dns"
      config/printer               astring       "user files nis"
      config/publickey             astring       nis

      在此系统上,列出 publickey 的值,因为它不同于缺省值 files

  2. 使用 newkey 命令创建一个新密钥对。
    # newkey -h hostname

    其中,hostname 是客户机的名称。

示例 10-1  在 NIS 客户机上为 root 设置新密钥

在以下示例中,分配了 "Name Service Security"(名称服务安全)权限配置文件的管理员将 earth 设置为安全 NIS 客户机。

# newkey -h earth
Adding new key for unix.earth@example.com
New Password: xxxxxxxx
Retype password: xxxxxxxx
Please wait for the database to get updated...
Your new key has been successfully stored away.
#