

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 步驟 4：設定 Amazon DCV 伺服器以使用代理程式做為身分驗證伺服器
<a name="configure-dcv-server"></a>

將 Amazon DCV 伺服器設定為使用代理程式做為外部身分驗證伺服器，以驗證用戶端連線字符。您也必須將 Amazon DCV 伺服器設定為信任代理程式的自我簽署 CA。

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

**新增 Linux Amazon DCV 伺服器的本機服務使用者**

1. 使用您偏好的文字編輯器開啟 `/etc/dcv/dcv.conf`。

1. 將 `ca-file`和 `auth-token-verifier` 參數新增至 `[security]`區段。
   + 針對 `ca-file`，指定您在上一個步驟中複製到主機之代理程式自我簽署 CA 的路徑。
   + 對於 `auth-token-verifier`，指定代理程式上字符驗證器的 URL，格式如下：`https://broker_ip_or_dns:port/agent/validate-authentication-token`。指定用於代理程式通訊的連接埠，預設為 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. 針對**值資料**，指定您在上一個步驟中複製到主機之代理程式自我簽署 CA 的路徑。
**注意**  
如果 參數不存在，請建立新的字串參數並將其命名為 `ca-file`。

1. 開啟 **auth-token-verifier** 參數。

1. 對於**值資料**，請指定代理程式上字符驗證器的 URL，格式如下：`https://broker_ip_or_dns:port/agent/validate-authentication-token`。

1. 指定用於代理程式通訊的連接埠，預設為 8445。如果您在 Amazon EC2 執行個體上執行代理程式，您必須使用私有 DNS 或私有 IP 地址。
**注意**  
如果 參數不存在，請建立新的字串參數並將其命名為 `auth-token-verifier`。

1. 選擇 **OK (確定)** 並關閉 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`，指定您在上一個步驟中複製到主機之代理程式自我簽署 CA 的路徑。
   + 對於 `auth-token-verifier`，指定代理程式上字符驗證器的 URL，格式如下：`https://broker_ip_or_dns:port/agent/validate-authentication-token`。指定用於代理程式通訊的連接埠，預設為 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)。

------