Go to main content

Oracle® ZFS Storage Appliance 管理指南,发行版 OS8.8.0

退出打印视图

更新时间: 2018 年 11 月
 
 

配置 NTP (CLI)

  1. configuration services ntp 下,使用 authkey 命令编辑授权:
    hostname:configuration services ntp> authkey
    hostname:configuration services ntp authkey>
    
  2. 在此上下文中,可使用 create 命令添加新密钥:
    hostname:configuration services ntp authkey> create
    hostname:configuration services ntp authkey-000 (uncommitted)> get
                            keyno = (unset)
                             type = (unset)
                              key = (unset)
    hostname:configuration services ntp authkey-000 (uncommitted)> set keyno=1
                            keyno = 1 (uncommitted)
    hostname:configuration services ntp authkey-000 (uncommitted)> set type=A 
                             type = A (uncommitted)
    hostname:configuration services ntp authkey-000 (uncommitted)> set key=coconuts
                              key = (set) (uncommitted)
    hostname:configuration services ntp authkey-000 (uncommitted)> commit
    hostname:configuration services ntp authkey> 
  3. 要通过 CLI 将验证密钥与服务器相关联,应将 serverkeys 属性设置为一系列值,其中的每个值是要与 servers 属性中对应的服务器相关联的一个密钥。

    如果服务器不使用验证,应将对应的服务器密钥设置为 0。例如,要使用上面创建的密钥验证服务器 "gefilte" 和 "carp":

    hostname:configuration services ntp> set servers=gefilte,carp
                          servers = gefilte,carp (uncommitted)
    hostname:configuration services ntp> set serverkeys=1,1
                       serverkeys = 1,1 (uncommitted)
    hostname:configuration services ntp> commit
    hostname:configuration services ntp>
  4. 要将验证密钥与服务器相关联,请将 serverkeys 属性设置为一系列值,其中的每个值是要与 servers 属性中对应的服务器相关联的一个密钥。

    如果服务器不使用验证,应将对应的服务器密钥设置为 0。例如,要使用上面创建的密钥验证服务器 "gefilte" 和 "carp":

    hostname:configuration services ntp> set servers=gefilte,carp
                          servers = gefilte,carp (uncommitted)
    hostname:configuration services ntp> set serverkeys=1,1
                       serverkeys = 1,1 (uncommitted)
    hostname:configuration services ntp> commit
    hostname:configuration services ntp>
  5. 要用密钥 1 验证服务器 "gefilte"、用密钥 2 验证服务器 "carp",并用密钥 3 验证服务器 "dory":
    hostname:configuration services ntp> set servers=gefilte,carp,dory
                          servers = gefilte,carp,dory (uncommitted)
    hostname:configuration services ntp> set serverkeys=1,2,3
                       serverkeys = 1,2,3 (uncommitted)
    hostname:configuration services ntp> commit
    hostname:configuration services ntp>
  6. 要用密钥 1 验证服务器 "gefilte" 和 "carp",并另外设置一个未经验证的 NTP 服务器 "dory",请执行以下操作:
    hostname:configuration services ntp> set servers=gefilte,carp,dory
                          servers = gefilte,carp,dory (uncommitted)
    hostname:configuration services ntp> set serverkeys=1,1,0
                       serverkeys = 1,1,0 (uncommitted)
    hostname:configuration services ntp> commit
    hostname:configuration services ntp>