---
schema_version: "1"
id: 632bed348fe870c001eb55b290d89947316916dca65e64fe031a1f724350b368
title: 管理伺服器密碼
collection: tableau
version: current
locale: zh-tw
portal_url: https://docs.salesforce.com/tableau/current/zh-tw/server-linux/security_secret_storage.md
canonical_url: https://help.tableau.com/current/server-linux/zh-tw/security_secret_storage.htm
source_site: help.tableau.com
content_type: documentation
content_hash: 263f8b1ff72cdbf0cc048bcdbdd3309d0ee6c4789aa85c8c67df444b5aad5508
description: Understand and manage how Tableau Server stores secrets.
---
[跳至主要內容](#main-content)

# 管理伺服器密碼

Tableau Server 需要儲存它使用的一些密碼以執行各種功能，通常包括保護內部通訊的安全、與其他應用程式或作業系統通訊，或實現與用戶端的安全通訊。在此上下文中，術語_密碼_可能是指密碼、權杖或用於向另一個實體驗證某個實體身分的其他字串。

執行 Tableau Server 需要兩種類別的密碼。這兩種密碼根據其組建方式而有所不同。

- **管理員組建的密碼**。這些密碼包括執行身分使用者帳戶的認證及關聯密碼，以及 Tableau Server 使用的 SMTP 認證。
- **由系統中的各種處理序自動組建的密碼**。例如，需要一個密碼來保護叢集控制器和 ZooKeeper 處理序之間的通訊。並且，每個與 Postgres 通訊的服務和程式設計使用者都需要一些不同的密碼。

大多數密碼在空閒時將被加密。需要密碼時，將會在執行時對其進行解密。

本主題介紹密碼存儲的工作方式，並介紹了在 Tableau Server 上正確管理密碼存儲所需執行的操作。

## 瞭解密碼存儲的工作方式

在安裝期間，Tableau Server 會在 Java 金鑰存儲中組建和存儲一個主金鑰。主金鑰用於對系統中使用的設定加密金鑰進行加密。

每當建立或更新一個新密碼時，將會使用設定加密金鑰對該密碼進行加密。加密值隨後與其對應的設定參數一起存儲在伺服器上的一個 YAML 檔案中。儲存加密值的參數使用 `ENC(<encrypted string>)` 格式，其中 `<encrypted string>` 是 Base64 編碼的加密字串。

在執行時，當需要存取給定密碼時，系統會將加密值讀取到記憶體中，並使用設定加密金鑰對其進行解密。

在擱置變更的情況下，在組態變更期間輸入密碼時，會加密整個交易。在這種情況下，輸入密碼然後儲存擱置變更之後，密碼會傳輸到協調服務（透過加密的 SSL）。協調服務會加密密碼，並儲存該密碼，直到套用擱置的變更為止。套用變更時，密碼（仍處於加密狀態）會升級到目前的組態版本。

Tableau Server 在 GCM 模式下使用 256 位 AES 對密碼進行加密。用於保護存儲安全的金鑰與用於在將嵌入資料庫認證存儲在存放庫中之前對其進行加密的資產金鑰不同。

### 誰具有主金鑰的存取權限？

在預設安裝中，系統會為該節點的每個服務將 Tableau Server 的 Java Keystore 會複製到 `/var/opt/tableau/tableau_server/data/tabsvc/config` 下的 `/tabsvc/keystores` 資料夾中。

例如，

`/var/opt/tableau/tableau_server/data/tabsvc/config/tabadminagent_<version_number>/tabsvc/keystores/tableauserver.jks`。

如果使用自訂安裝目錄，則金鑰存儲檔案將位於

`<install directory>/tableau_server/data/tabsvc/config/<service name_#.version_number>/tabsvc/keystores`

預設情況下，以下使用者和群組具有此目錄的存取權限：

- 根
- tableau（使用者）
- 「tableau」群組的成員

### 匯入和匯出設定資訊

Tableau 服務管理員引入了使用 [tsm settings export](https://help.tableau.com/current/server-linux/zh-tw/cli_settings_tsm.htm#TSMExport) 匯入與匯出設定資訊的功能。

**附註：**此版本的 Tableau Server 不支援從備份還原設定資訊。作為替代，我們建議使用匯出和匯入設定命令來備份和還原設定資訊。

儘管在以內部方式存儲在磁碟上時設定密碼已加密，但在將設定匯出到檔案時，密碼將以純文字形式寫入檔案。管理員負責採取措施來保護此檔案。有各種可用選項：

- 將檔案寫入加密的檔案系統。
- 將檔案寫入由檔案系統權限限制為只有特定使用者或群組才能存取的目錄。
- 對輸出檔案進行加密。

### 保護用於匯入和匯出操作的密碼

此部分介紹如何對備份輸出進行 PGP 加密。利用此方法，您將建立一個具名管道並將其作為 file 參數提供，然後使用該內容作為 gpg 的輸入以對其進行加密。優點是，密碼決不會以純文字形式寫入磁碟。必須有 gpg 和私密金鑰。以下部分中顯示了此方法的範例。

此部分中的範例介紹了一種處理密碼以在單獨的電腦上存儲密碼的方式。

有關詳情，請參閱以下外部參考：

- [命令列上的檔案加密](http://backreference.org/2014/08/15/file-encryption-on-the-command-line/)
- [mkfifo(1) - Linux man 頁面](https://linux.die.net/man/1/mkfifo)

範例：加密和匯出

下面是一個範例，示範在匯出設定時如何保護檔案的安全。

`mkfifo -m 600 /tmp/secure1 && (gpg --symmetric --batch --yes --passphrase-file ~/.secrets/pgppassphrase.txt --cipher-algo AES256 --output encrypted.enc < /tmp/secure1 &) && tsm settings export -f /tmp/secure1 && rm /tmp/secure1`

此操作的詳情為：

- 建立一個具名管道，目前使用者對其的存取權限由檔案權限限制為讀寫。
    
    `mkfifo -m 600 /tmp/secure1`
- 調用 gpg 對傳送至具名管道的資料進行加密，並將其作為單獨處理序在背景執行。它將阻止等待資料。結果將是一個包含加密資料的檔案。
    
    `gpg --symmetric --batch --yes --passphrase-file ~/.secrets/pgppassphrase.txt --cipher-algo AES256 --output encrypted.enc < /tmp/secure1 &`
- 調用 tsm 以匯出設定，同時提供具名管道作為 file 參數。
    
    `tsm settings export -f /tmp/secure1`
- 刪除具名管道。
    
    `rm /tmp/secure1`

加密的資料存儲在檔案「encrypted.enc」。

**範例：解密和匯入**

下面是一個範例，示範如何解密和匯入設定。

`mkfifo -m 600 /tmp/secret2 && (gpg --decrypt --batch --yes --passphrase-file ~/.secrets/pgppassphrase.txt encrypted.enc > /tmp/secret2 &) && tsm settings import -f /tmp/secret2 && rm /tmp/secret2`

此操作的詳情為：

- 建立一個具名管道，目前使用者對其的存取權限由檔案權限限制為讀寫。
    
    `mkfifo -m 600 /tmp/secure2`
- 解密設定並將其傳送至具名管道。將此處理序作為單獨處理序在背景執行，它將阻止等待讀取操作。
    
    `gpg --decrypt --batch --yes --passphrase-file ~/.secrets/pgppassphrase.txt encrypted.enc > /tmp/secret2 &`
- 執行 tsm configuration import 命令，並根據需要登入。
    
    `tsm settings import -f /tmp/secret2`
- 刪除具名管道。
    
    `rm /tmp/secure1`

待定設定包含匯入的設定。

執行 [tsm pending-changes apply](https://help.tableau.com/current/server-linux/zh-tw/cli_pending-changes.htm#pending-changes-apply) 提交變更。如果擱置組態需要重新啟動伺服器，`pending-changes apply` 命令將顯示提示，讓您知道即將重新啟動。即使伺服器已停止，也會顯示提示，但在這種情況下不會重新啟動。您可以使用 `--ignore-prompt` 選項隱藏提示，但這樣做不會改變重新啟動行為。如果變更不需要重新啟動，則不會出現提示即可套用變更。有關詳情，請參閱 [tsm pending-changes apply](https://help.tableau.com/current/server-linux/zh-tw/cli_pending-changes.htm#pending-changes-apply)。

### 叢集節點

將新節點新增到 Tableau Server 叢集時，您首先將需要組建節點設定檔 ([tsm topology](https://help.tableau.com/current/server-linux/zh-tw/cli_topology_tsm.htm#topology-get-bootstrap-file))。節點設定檔包含用於對設定密碼加密的主金鑰存儲檔案的副本。

**重要資訊**：我們強烈建議您採取額外措施，在匯出包含密碼的設定檔時保護節點設定檔的安全。

[在新節點上安裝和設定 Tableau Server](https://help.tableau.com/current/server-linux/zh-tw/install_additional_nodes.htm) 時，您將需要向 `initialize-tsm` 命令提供節點設定檔。您可以使用類似於如上所述的技術來對以前加密的檔案內容進行解密，並透過具名管道將其傳送給 `initialize-tsm` 命令。

### 密碼存儲事件記錄

將記錄與密碼存儲相關的以下事件：

- 組建新加密金鑰
- 加密金鑰已回滾或變更
- 對設定檔中的新值進行加密

有關記錄檔案及其存儲位置的詳情，請參閱[使用記錄檔](https://help.tableau.com/current/server-linux/zh-tw/logs_working_with.htm)。

## 管理密碼

作為 Tableau Server 管理員，與密碼存儲相關的最重要工作是定期更新密碼。在某些情況（伺服器故障的排除或審計）下，您可能需要檢索密碼。

對於其他操作，例如升級版本、備份和還原或向叢集中新增新節點（如上所述），Tableau Server 會自動管理密碼存儲和相關過程。

### 更新密碼

您應根據公司的安全性原則定期更新密碼。

若要更新主要金鑰並自動產生密碼，請執行 [tsm security regenerate-internal-tokens](https://help.tableau.com/current/server-linux/zh-tw/cli_security_tsm.htm#regenerate-tokens)。

### 檢索密碼

在某些情況下，您可能需要為故障排除或其他操作檢索密碼。例如，您可能需要由 Tableau Server 組建並加密的 Postgres readonly 使用者認證。在這些情況下，您可以執行一個 tsm 命令，該命令將為您檢索密碼並對其進行解密。

若要檢索密碼，請開啟命令提示符，並針對下表中列出的其中一個參數發出 `tsm configuration get` 命令。

例如，若要檢索 readonly Postgres 使用者的密碼，請鍵入以下命令：

`tsm configuration get -k pgsql.readonly_password`

該命令將以明文形式返回密碼：

`$ tsm configuration get -k pgsql.readonly_password`

`password`

<table style="width: 100%;" class="simple-table"><colgroup><col style="width: 50%;"><col style="width: 50%;"></colgroup><tbody><tr><th>Configuration Parameter</th><th>Description</th></tr><tr><td>clustercontroller.zookeeper.password</td><td>Password for cluster controller to connect to zookeeper.</td></tr><tr><td>indexandsearchserver.client.password             
						

					</td><td>Password for logging into Index and Search Server. 

					</td></tr><tr><td>indexandsearchserver.ssl.admin.cert.bytes             
					</td><td>Admin certificate that is used for administrative access to the Index and Search Server. The admin certificate is used to generate the node certificate. 

					</td></tr><tr><td>indexandsearchserver.ssl.admin.key.file_bytes 
					</td><td>Certificate key for administrative access to the Index and Search Server. 

					</td></tr><tr><td>indexandsearchserver.ssl.node.cert.bytes </td><td>Certificate that is used for Index and Search Server node-to-node communication.

					</td></tr><tr><td>            
						indexandsearchserver.ssl.node.key.file_bytes             
					</td><td>Certificate key that is used for Index and Search Server node-to-node communication.</td></tr><tr><td>indexandsearchserver.ssl.root.cert.bytes             
					</td><td>Certificate that is used to sign the admin and node certificates . This certificate is used by TSM&nbsp;for health check and by NLP&nbsp;to connect to Index and Search Server. 

					</td></tr><tr><td>indexandsearchserver.ssl.root.key.file_bytes </td><td>Certificate key for root certificate.

					</td></tr><tr><td>filestore.zookeeper.password</td><td>Password for filestore to connect to zookeeper.</td></tr><tr><td>hyper.connection.init_password 

					</td><td>Password used to initialize the Hyper database for user <code>tableau_internal_user</code> and is then used for connecting to Hyper.

					</td></tr><tr><td>jdbc.password</td><td>Password for the rails Postgres user.</td></tr><tr><td>kms.persistent_store 

					</td><td>A collection of master encryption keys (MEKs) used by the Key Management System.

					</td></tr><tr><td>maestro.rserve.password             
						</td><td>Password for connecting to an external Rserve instance used by Tableau Prep Conductor for running flows that have nodes with R scripts. 

					</td></tr><tr><td>maestro.tabpy.password</td><td>Password for connecting to an external TabPy (Python server) instance used by Tableau Prep Conductor for running flows that have nodes with Python scripts. 

					</td></tr><tr><td>oauth.google.client_secret</td><td>Client secret of the Google Cloud Platform account. </td></tr><tr><td>oauth.quickbooks.consumer_secret</td><td>Consumer secret of the Intuit developer account. </td></tr><tr><td>oauth.salesforce.client_secret</td><td>Client secret of the Salesforce developer account. </td></tr><tr><td>pgsql.adminpassword</td><td><p>tblwgadmin Postgres 使用者的密碼。</p><p class="note"><b>附註</b>：儘管設定參數在 Tableau 的設定檔（tabsvc.yml、workgroup.yml）中已加密，但此密碼將以純文字形式儲存在 SAML 使用的檔案中。</p></td></tr><tr><td>pgsql.readonly_password</td><td>Password for the readonly Postgres user.</td></tr><tr><td>pgsql.remote_password</td><td>Password for the tableau Postgres user.</td></tr><tr><td>redis.password </td><td><p>Redis 的密碼。</p><p class="note"><b>附註：</b>儘管設定參數在 Tableau 的設定檔（tabsvc.yml、workgroup.yml）中已加密，但此設定將以純文字形式儲存在由 Redis 應用程式所使用的 redis.conf 檔案中。Redis 不支援加密/安全密碼。</p></td></tr><tr><td>servercrashupload.proxy_server_password</td><td>Password for custom proxy server used to upload crash reports.</td></tr><tr><td>service.runas.password</td><td>Password of the Run As users. Stored temporarily.</td></tr><tr><td>ssl.cert.file_bytes             
					</td><td>The content of one of the three SSL certificate files uploaded by the administrator. The certificate files are required to enable secure external connections to Tableau Server. </td></tr><tr><td>ssl.chain.file_bytes 
					</td><td>The chain file(s) for the certificates uploaded by the administrator for external SSL.</td></tr><tr><td>ssl.key.file_bytes</td><td>Key file(s) for the certificates uploaded by the administrator for external SSL.</td></tr><tr><td>ssl.key.passphrase</td><td>Optional passphrase used to protect the external SSL key.</td></tr><tr><td>svcmonitor.notification.smtp.password</td><td>SMTP Server password supplied by the administrator through TabConfig.exe.</td></tr><tr><td>tabadminservice.password</td><td>Password for the service that allows server admins to download log files through the web interface.</td></tr><tr><td>vizportal.openid.client_secret</td><td>This is the password ("provider client secret") used for  OpenID Connect SSO.</td></tr><tr><td>
                        vizqlserver.external_proxy_password
                    </td><td>Password used to authenticate to an external proxy.</td></tr><tr><td>wgserver.domain.password</td><td>Password used to bind to Active Directory. </td></tr><tr><td>wgserver.saml.key.passphrase</td><td>Passphrase used to access the PKCS#8 SAML key file.</td></tr><tr><td>zookeeper.tsm.password</td><td>Password that TSM&nbsp;uses to connect to Zookeeper coordination service</td></tr></tbody></table>