

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 步骤 4：配置 Amazon DCV 服务器以将 Broker 作为身份验证服务器
<a name="configure-dcv-server"></a>

配置 Amazon DCV 服务器以将 Broker 作为外部身份验证服务器，以验证客户端连接令牌。您还必须将 Amazon DCV 服务器配置为信任 Broker 的自签名 CA。

------
#### [ Linux Amazon DCV server ]

**为 Linux Amazon DCV 服务器添加本地服务用户**

1. 使用所需的文本编辑器打开 `/etc/dcv/dcv.conf`。

1. 将 `ca-file` 和 `auth-token-verifier` 参数添加到 `[security]` 部分中。
   + 对于 `ca-file`，指定您在上一步中复制到主机的 Broker 自签名 CA 的路径。
   + 对于 `auth-token-verifier`，按以下格式指定 Broker 上的令牌验证程序的 URL：`https://broker_ip_or_dns:port/agent/validate-authentication-token`。指定用于 Broker-Agent 通信的端口，默认为 8445。如果您在 Amazon EC2 实例上运行代理，则必须使用私有 DNS 或私有 IP 地址。

     例如

     ```
     [security]
     ca-file="/etc/dcv-session-manager-agent/broker_cert.pem"
     auth-token-verifier="https://my-sm-broker.com:8445/agent/validate-authentication-token"
     ```

1. 保存并关闭文件。

1. 停止并重新启动 Amazon DCV 服务器。有关更多信息，请参阅《Amazon DCV 管理员指南》中的[停止 Amazon DCV 服务器](https://docs.aws.amazon.com/dcv/latest/adminguide/manage-stop.html)和[启动 Amazon DCV 服务器](https://docs.aws.amazon.com/dcv/latest/adminguide/manage-start.html)。**

------
#### [ Windows Amazon DCV server ]

**在 Windows Amazon DCV 服务器上**

1. 打开 Windows 注册表编辑器并导航到 **HKEY\$1USERS/S-1-5-18/Software/GSettings/com/nicesoftware/dcv/security/键**。

1. 打开 **ca-file** 参数。

1. 对于**值数据**，指定您在上一步中复制到主机的 Broker 自签名 CA 的路径。
**注意**  
如果该参数不存在，则创建一个新的字符串参数并将其命名为 `ca-file`。

1. 打开**auth-token-verifier**参数。

1. 对于**值数据**，按以下格式指定 Broker 上的令牌验证程序的 URL：`https://broker_ip_or_dns:port/agent/validate-authentication-token`。

1. 指定用于 Broker-Agent 通信的端口，默认为 8445。如果您在 Amazon EC2 实例上运行代理，则必须使用私有 DNS 或私有 IP 地址。
**注意**  
如果该参数不存在，则创建一个新的字符串参数并将其命名为 `auth-token-verifier`。

1. 选择**确定**，并关闭 Windows 注册表编辑器。

1. 停止并重新启动 Amazon DCV 服务器。有关更多信息，请参阅《Amazon DCV 管理员指南》中的[停止 Amazon DCV 服务器](https://docs.aws.amazon.com/dcv/latest/adminguide/manage-stop.html)和[启动 Amazon DCV 服务器](https://docs.aws.amazon.com/dcv/latest/adminguide/manage-start.html)。**

------
#### [ macOS Amazon DCV server ]

**为 macOS 的 Amazon DCV 服务器添加本地服务用户**

1. 使用所需的文本编辑器打开 `/etc/dcv/dcv.conf`。

1. 将 `ca-file` 和 `auth-token-verifier` 参数添加到 `[security]` 部分中。
   + 对于 `ca-file`，指定您在上一步中复制到主机的 Broker 自签名 CA 的路径。
   + 对于 `auth-token-verifier`，按以下格式指定 Broker 上的令牌验证程序的 URL：`https://broker_ip_or_dns:port/agent/validate-authentication-token`。指定用于 Broker-Agent 通信的端口，默认为 8445。如果您在 Amazon EC2 实例上运行代理，则必须使用私有 DNS 或私有 IP 地址。

     例如

     ```
     [security]
     ca-file="/usr/local/etc/dcv-session-manager-agent/broker_cert.pem"
     auth-token-verifier="https://my-sm-broker.com:8445/agent/validate-authentication-token"
     ```

1. 保存并关闭文件。

1. 停止并重新启动 Amazon DCV 服务器。有关更多信息，请参阅《Amazon DCV 管理员指南》中的[停止 Amazon DCV 服务器](https://docs.aws.amazon.com/dcv/latest/adminguide/manage-stop.html)和[启动 Amazon DCV 服务器](https://docs.aws.amazon.com/dcv/latest/adminguide/manage-start.html)。**

------