NetWorker:如何匯入或更換「AUTHC」和「NWUI」的認證授權單位簽署憑證 (Linux)

摘要: 以下是將預設 NetWorker 自我簽署憑證更換為「AUTHC」和 NetWorker Web UI (NWUI) 服務的認證機構 (CA) 簽署憑證的一般步驟。

本文章適用於 本文章不適用於 本文無關於任何特定產品。 本文未識別所有產品版本。

說明

這些指示說明如何為 NetWorker 伺服器上的 NetWorker 驗證 (AUTHC) 和 NetWorker Web UI (NWUI) 服務,將預設的 NetWorker 自我簽署憑證更換為 CA 簽署憑證。

檔名沒有命名要求,但應引用檔類型的擴展名。顯示的命令範例適用於 Linux。如需 Windows 指示,請參閱:
NetWorker:如何匯入或更換「AUTHC」和「NWUI」的認證授權單位簽署憑證 (Windows)
 

注意:如果環境在 NetWorker Virtual Edition (NVE) 伺服器上執行,請使用 NetWorker Runtime Environment Java keytool 公用程式的完整路徑 (/opt/nre/java/latest/bin/keytool),而非預設的 Java keytool 公用程式 (/usr/bin/keytool)。


涉及的認證檔案:

<server>.csr: NetWorker server certificate signing request

<server>.key: NetWorker server private key

<server>.crt: NetWorker server CA-signed certificate

<CA>.crt: CA root certificate

<ICA>.crt: CA intermediate certificate (optional if it is available)

涉及的金鑰存放區:

authc.keystore

authc.truststore

cacerts

nwui.keystore

產生私人金鑰和憑證簽署要求 (CSR) 檔案以提供給您的 CA。

  • 使用 OpenSSL 命令列公用程式建立 NetWorker 伺服器私密金鑰檔案 (<server>.key) 和 CSR 檔案 (<server>.csr)。

    # openssl req -new -newkey rsa:4096 -nodes -out /tmp/<server>.csr -keyout /tmp/<server>.key
  • 傳送 CSR 檔案 (<server>.csr) 至 CA 以產生 CA 簽署的憑證檔 (<server>.crt)。CA 應提供 CA 簽署的憑證檔案 (<server>.crt)、根憑證 (<CA>.crt),以及任何中繼 CA 憑證 (<ICA>.crt)。

預先驗證步驟:

請確定您具備下列項目:

  • server.crt 檔案,其中包含 PEM 憑證,其第一行為 -----BEGIN CERTIFICATE-----最後一行為 -----END CERTIFICATE-----
  • 金鑰檔案以 -----BEGIN RSA PRIVATE KEY-----開頭,-----END RSA PRIVATE KEY」結束-----
  • 執行此命令,確認所有憑證均為有效的 PEM 格式檔案 openssl x509 -in <cert> -text -noout
  • 驗證上述輸出,確定其是正確的憑證。
  • 檢查下列兩個命令的輸出:
    openssl rsa -pubout -in server.key
    openssl x509 -pubkey -noout -in server.crt
    這兩個命令的輸出必須匹配。

為了便於執行以下所述步驟和命令,我們建立了以下變數:

java_bin=/opt/nre/java/latest/bin
nsr=<path to /nsr partition> # In case of NVE for instance this is /data01/nsr
cert=<path to server crt file>
key=<path to server key file>
RCAcert=<path to Root CA file>
ICAcert=<path to intermediate CA crt file>

如果有多個中間證書,請為每個證書創建變數:ICA1、ICA2 等

您必須知道正確的 NetWorker 金鑰存放區密碼。這些密碼是在 AUTHC 和 NWUI 組態期間設定。如果您不確定,請參閱:

您還可以使用金鑰庫傳遞變數(選項 1)或將它們儲存在檔中以隱藏密碼(選項 2):
選項 1 的範例:

authc_storepass='P4ssw0rd!'
nwui_storepass='Password1!'

選項 2 的範例:

authc_storepass=$(cat authc_storepass_file.txt)
nwui_storepass=$(cat nwui_storepass_file.txt)

開始之前:

製作 Java cacerts 檔案的備份複本。 

cp -p /opt/nre/java/latest/lib/security/cacerts /tmp/cacerts_$(date -I).bkp
注意:如果發生任何問題,您可以還原至原始 cacerts 檔案,並使用預設自我簽署憑證重新產生 AUTHC 和 NWUI 金鑰存放區。請參閱本文的 「其他資訊 」一節,以取得還原至原始檔案的指示。

認證服務憑證更換步驟:

可使用 authc 不必停止服務,以下過程即可工作。但是,必須重新啟動它才能載入新證書。

  1. 匯入憑證

    • 匯入根憑證 (<CA>.crt) 和任何中間 CA 憑證 (<ICA>.crt) 放入 authc.keystore

      $java_bin/keytool -import -alias RCA -keystore $nsr/authc/conf/authc.keystore -file $RCAcert -storepass $authc_storepass
      $java_bin/keytool -import -alias RCA -keystore /opt/nsr/authc-server/conf/authc.truststore -file $RCAcert -storepass $authc_storepass
      
      $java_bin/keytool -import -alias ICA -keystore $nsr/authc/conf/authc.keystore -file $ICAcert -storepass $authc_storepass
      $java_bin/keytool -import -alias ICA -keystore /opt/nsr/authc-server/conf/authc.truststore -file $ICAcert -storepass $authc_storepass
    • 使用 NetWorker 伺服器私人金鑰檔案 (<server>.key) 和新的 CA 簽署憑證檔案 (<server>.crt) 以建立 PKCS12 儲存檔案 emcauthctomcatemcauthcsaml 別名。

      openssl pkcs12 -export -in $cert -inkey $key -name emcauthctomcat -out /tmp/$hostname.tomcat.authc.p12 -password pass:$authc_storepass
      openssl pkcs12 -export -in $cert -inkey $key -name emcauthcsaml -out /tmp/$hostname.saml.authc.p12 -password pass:$authc_storepass
      注意:此 pkcs12 檔案密碼必須與金鑰存放區的密碼相符。這就是為什麼在這種情況下,我們使用 authc 商店通行證。
    • 將 PKCS12 儲存檔案匯入 authc.keystore

      $java_bin/keytool -importkeystore -destkeystore /nsr/authc/conf/authc.keystore -srckeystore /tmp/$hostname.tomcat.authc.p12 -srcstoretype PKCS12 -srcstorepass $authc_storepass -deststorepass $authc_storepass
      $java_bin/keytool -importkeystore -destkeystore /nsr/authc/conf/authc.keystore -srckeystore /tmp/$hostname.saml.authc.p12 -srcstoretype PKCS12 -srcstorepass $authc_storepass -deststorepass $authc_storepass
    • 將 PKCS12 儲存檔案匯入 authc.truststore

      $java_bin/keytool -importkeystore -destkeystore /opt/nsr/authc-server/conf/authc.truststore -srckeystore /tmp/$hostname.tomcat.authc.p12 -srcstoretype PKCS12 -srcstorepass $authc_storepass -deststorepass $authc_storepass
      $java_bin/keytool -importkeystore -destkeystore /opt/nsr/authc-server/conf/authc.truststore -srckeystore /tmp/$hostname.saml.authc.p12 -srcstoretype PKCS12 -srcstorepass $authc_storepass -deststorepass $authc_storepass
    • 刪除預設的 NetWorker 自我簽署憑證,並匯入新的 CA 簽署憑證檔案 (<server>.crt) 放入 authc.truststore.

      $java_bin/keytool -delete -alias emcauthctomcat -keystore /opt/nsr/authc-server/conf/authc.truststore -storepass $authc_storepass
      $java_bin/keytool -import -alias emcauthctomcat -keystore /opt/nsr/authc-server/conf/authc.truststore -file $cert -storepass $authc_storepass
      $java_bin/keytool -delete -alias emcauthcsaml -keystore /opt/nsr/authc-server/conf/authc.truststore -storepass $authc_storepass
      $java_bin/keytool -import -alias emcauthcsaml -keystore /opt/nsr/authc-server/conf/authc.truststore -file $cert -storepass $authc_storepass
    • 最後,請將此憑證匯入 Java cacerts 金鑰存放區檔案,路徑為: emcauthctomcat 別名:

      $java_bin/keytool -delete -alias emcauthctomcat -keystore $java_bin/../lib/security/cacerts -storepass changeit
      $java_bin/keytool -import -alias emcauthctomcat -keystore $java_bin/../lib/security/cacerts -file $cert -storepass changeit
      注意:如果您使用的是 NetWorker 19.13 (或更新版本), keytool 匯入時命令可能會傳回警告 cacerts 證書。警告表示要使用 -cacerts 而不是 -keystore。儘管有警告,但仍可放心忽略此問題,本文中顯示的語法仍會匯入憑證。另一種方法是將”-keystore $java_bin/../lib/security/cacerts“與”-cacerts“在命令中;這將刪除警告。
  2. 編輯 admin_service_default_url=localhost 值在 authc-cli-app.properties 檔,以反映 CA 簽署憑證檔案中使用的 NetWorker 伺服器名稱:

    cat /opt/nsr/authc-server/conf/authc-cli-app.properties
    admin_service_default_protocol=https
    admin_service_default_url=<my-networker-server.my-domain.com>
    admin_service_default_port=9090
    admin_service_default_user=
    admin_service_default_password=
    admin_service_default_tenant=
    admin_service_default_domain=
  3. 需要重新啟動 NetWorker 服務,才能 authc 以使用新導入的證書。
nsr_shutdown 
systemctl start networker
  1. 重新建立 authc NetWorker 伺服器上的信任:

    nsrauthtrust -H <local host or Authentication_service_host> -P 9090

認證後驗證

每個「憑證指紋」別名的輸出與其他金鑰存放區的輸出一致:

$java_bin/keytool -list -keystore $java_bin/../lib/security/cacerts -storepass changeit | grep emcauthctomcat -A1
$java_bin/keytool -list -keystore /opt/nsr/authc-server/conf/authc.truststore -storepass $authc_storepass | grep emcauthctomcat -A1
$java_bin/keytool -list -keystore $nsr/authc/conf/authc.keystore -storepass $authc_storepass | grep emcauthctomcat -A1

輸出應類似於以下內容:

Certificate fingerprint (SHA-256): FD:54:B4:11:42:87:FF:CA:80:77:D2:C7:06:87:09:72:70:85:C1:70:39:32:A9:C0:14:83:D9:3A:29:AF:44:90

此指紋來自已安裝的憑證。這表示已將新憑證正確導入不同的金鑰存放區中。

openssl x509 -in $cert -fingerprint -sha256 -noout

authc 服務已啟動並正在執行中,您可以檢查它提供給入站連接的證書是否與上述證書相同:

openssl x509 -in <(openssl s_client -connect localhost:9090 -prexit 2>/dev/null </dev/null | sed -n -e '/BEGIN\ CERTIFICATE/,/END\ CERTIFICATE/ p') -fingerprint -sha256 -noout

或者,您可以檢查埠 9090 使用的證書的消費者和頒發者:

openssl s_client -connect localhost:9090 -showcerts 2>/dev/null </dev/null | grep -E "issuer|subject"

NetWorker 使用者介面 (nwui) 服務憑證更換步驟:

我們假設 nwui 服務正在 NetWorker 伺服器上執行。

  • 停止 nwui 服務

    systemctl stop nwui
  • 刪除預設的 NetWorker 自我簽署憑證,並匯入新的 CA 簽署憑證檔案 (<server>.crt) 複製到 cacerts 金鑰存放區。為了保持一致性,我們全部更換 nwui- 與 CA 簽署憑證相關的憑證。

    • 在執行下列步驟之前,您必須確定使用的是 NetWorker Runtime Environment (NRE) 還是 Java Runtime Environment (JRE)。
    • 如果使用 JRE,則 /cacerts 的路徑位於 $java_bin/../lib/security/cacerts
    • 如果使用 NRE,則 /cacerts 的路徑位於 /opt/nre/java/latest/lib/security/cacerts
      $java_bin/keytool -delete -alias emcnwuimonitoring -keystore $java_bin/../lib/security/cacerts -storepass changeit
      $java_bin/keytool -import -alias emcnwuimonitoring -keystore $java_bin/../lib/security/cacerts -file $cert -storepass changeit
      
      $java_bin/keytool -delete -alias emcnwuiserv -keystore $java_bin/../lib/security/cacerts -storepass changeit
      $java_bin/keytool -import -alias emcnwuiserv -keystore $java_bin/../lib/security/cacerts -file $cert -storepass changeit
      
      $java_bin/keytool -delete -alias emcnwuiauthc -keystore $java_bin/../lib/security/cacerts -storepass changeit
      $java_bin/keytool -import -alias emcnwuiauthc -keystore $java_bin/../lib/security/cacerts -file $cert -storepass changeit
      注意:如果您使用的是 NetWorker 19.13 (或更新版本), keytool 匯入時命令可能會傳回警告 cacerts 證書。警告表示要使用 -cacerts 而不是 -keystore。儘管有警告,但仍可放心忽略此問題,本文中顯示的語法仍會匯入憑證。另一種方法是將”-keystore $java_bin/../lib/security/cacerts“與”-cacerts“在命令中;這將刪除警告。
  • 使用 NetWorker 伺服器私人金鑰檔案 (<server>.key) 和新的 CA 簽署憑證檔案 (<server>.crt) 以建立 PKCS12 儲存檔案 emcauthctomcatemcauthcsaml 的別名 nwui 金鑰存放區。

    openssl pkcs12 -export -in $cert -inkey $key -name emcauthctomcat -out /tmp/$hostname.tomcat.nwui.p12 -password pass:$nwui_storepass
    openssl pkcs12 -export -in $cert -inkey $key -name emcauthcsaml -out /tmp/$hostname.saml.nwui.p12 -password pass:$nwui_storepass
    注意:此 pkcs12 檔案密碼必須與金鑰存放區的密碼相符。這就是為什麼在這種情況下,我們使用 nwui 商店通行證。
  • 將 .p12 檔案、根 CA 憑證和中間 CA 憑證匯入 nwui 金鑰存放區。

    $java_bin/keytool -importkeystore -destkeystore $nsr/nwui/monitoring/app/conf/nwui.keystore -srckeystore /tmp/$hostname.tomcat.nwui.p12 -srcstoretype PKCS12 -srcstorepass $nwui_storepass -deststorepass $nwui_storepass
    
    $java_bin/keytool -importkeystore -destkeystore $nsr/nwui/monitoring/app/conf/nwui.keystore -srckeystore /tmp/$hostname.saml.nwui.p12 -srcstoretype PKCS12 -srcstorepass $nwui_storepass -deststorepass $nwui_storepass
    
    $java_bin/keytool -import -alias RCA -keystore $nsr/nwui/monitoring/app/conf/nwui.keystore -file $RCAcert -storepass $nwui_storepass
    
    $java_bin/keytool -import -alias ICA -keystore $nsr/nwui/monitoring/app/conf/nwui.keystore -file $ICAcert -storepass $nwui_storepass
  • 重新命名 emcnwuimonitoringemcnwuiauthc以及 emcnwuiserv 憑證,並將我們的伺服器憑證放在此路徑中,名稱相同。系統會提示您覆寫原始檔案 (這會保留現有的擁有權和權限)

    cp -p /nsr/nwui/monitoring/app/conf/emcnwuimonitoring.cer /nsr/nwui/monitoring/app/conf/emcnwuimonitoring.cer_orig
    cp $cert /nsr/nwui/monitoring/app/conf/emcnwuimonitoring.cer
    
    mv -p /opt/nwui/conf/emcnwuiauthc.cer /opt/nwui/conf/emcnwuiauthc.cer_orig
    cp $cert /opt/nwui/conf/emcnwuiauthc.cer
    
    cp -p /opt/nwui/conf/emcnwuiserv.cer /opt/nwui/conf/emcnwuiserv.cer_orig
    cp $cert /opt/nwui/conf/emcnwuiserv.cer
    注意:系統會提示您覆寫原始檔案 (這會保留現有的擁有權和權限)
  • nwui PostgreSQL 憑證更換步驟

    cp -p $nsr/nwui/monitoring/nwuidb/pgdata/server.crt /nsr/nwui/monitoring/nwuidb/pgdata/server.crt_orig
    cp -p $nsr/nwui/monitoring/nwuidb/pgdata/server.key /nsr/nwui/monitoring/nwuidb/pgdata/server.key_orig
    cp $cert $nsr/nwui/monitoring/nwuidb/pgdata/server.crt
    cp $key $nsr/nwui/monitoring/nwuidb/pgdata/server.key
    注意:系統會提示您覆寫原始檔案 (這會保留現有的擁有權和權限)
  • 啟動 nwui 服務

    systemctl start nwui

nwui 驗證後:

每個「憑證指紋」別名的輸出與其他金鑰存放區的輸出一致:

$java_bin/keytool -list -keystore $nsr/nwui/monitoring/app/conf/nwui.keystore -storepass $nwui_storepass | grep emcauthctomcat -A1
$java_bin/keytool -list -keystore $java_bin/../lib/security/cacerts -storepass changeit | grep emcauthctomcat -A1
$java_bin/keytool -list -storepass $authc_storepass -keystore $nsr/authc/conf/authc.keystore | grep emcauthctomcat -A1

此指紋來自已安裝的憑證。這表示已將新憑證正確導入不同的金鑰存放區中。

openssl x509 -in $cert -fingerprint -sha256 -noout

或者,您可以檢查埠 9090 使用的證書的消費者和頒發者:

openssl s_client -connect localhost:9095 -showcerts 2>/dev/null </dev/null | grep -E "issuer|subject"

NetWorker 管理主控台:

本文會介紹本主題:NetWorker:如何匯入或更換 NMC 的認證授權單位簽署憑證

NetWorker HTTP 嚴格傳輸安全性 (HSTS):

NetWorker:如何在 NetWorker Apache Tomcat 伺服器中啟用 HSTS 組態

其他資訊

下列指示可用來回復至 cacerts 在遵循本文之前創建的檔案副本。下列程序也會重設 NetWorker 以使用 AUTHC 和 NWUI 的預設自我簽署憑證。 

 

  1. 確認您有備份副本。如果使用了「 開始之前 」命令,則應具有 Java 的過時副本 cacerts 檔案。 /tmp 目錄。例如:
[root@nsr ~]# ls -l /tmp | grep cacerts
-rwxr-xr-x. 1 root      root      129266 Mar 23 14:44 cacerts_2026-03-23.bkp
    1. 停止 NetWorker 服務:
    systemctl stop nwui
    nsr_shutdown
    1. 驗證 NetWorker 服務是否未執行:
    systemctl status networker
    systemctl status nwui
    1. 將 cacerts 檔案複製回其原始位置:
    注意: 本文演示 rsync 用法。這用於覆蓋現有檔,同時確保保留預設擁有權和許可權。
    rsync -a --no-perms --no-owner --no-group /tmp/cacerts_<date>.bkp /opt/nre/java/latest/lib/security/cacerts
    1. 重新執行 authc_configure.sh 編寫腳本並指定創建新金鑰庫的選項。範例:
    [root@nsr ~]# /opt/nsr/authc-server/scripts/authc_configure.sh
    
    Specify the directory where the Java Standard Edition Runtime Environment (JRE) software is installed [/opt/nre/java/latest]:
    
    The installation process will install an Apache Tomcat instance.
    For optimum security, EMC NetWorker Authentication Service will
    use a non-root user (nsrtomcat) to start the Apache Tomcat instance.
    If your system has special user security requirements, ensure that proper
    operational permissions are granted to this non-root user (nsrtomcat).
    Please refer to NetWorker Installation Guide.
    
    The Apache Tomcat will use "nsr.amer.lan" as the host name.
    The Apache Tomcat will use "9090" as the port number.
    
    The NetWorker Authentication Service requires a keystore file to configure encryption and to provide SSL support.
    
    EMC recommends that you specify a keystore password that has a minimum of six characters.
    
    Do you want to use the existing keystore /nsr/authc/conf/authc.keystore [y]? n
    
    The installation process will create a new keystore file.
    
    Specify the keystore password: HIDDEN_PASSWORD
    Confirm the password: HIDDEN_PASSWORD
    
    Creating the installation log in /opt/nsr/authc-server/logs/install.log.
    
    Performing initialization. Please wait...
    
    
    The installation completed successfully.
    1. 啟動 NetWorker 伺服器服務:
    systemct start networker
    1. 使用 nwui_configure.sh 編寫腳本並指定創建新金鑰庫的選項。範例:
    [root@nsr ~]# mv /nsr/nwui /nsr/nwui_$(date -I).bak
    [root@nsr ~]# /opt/nwui/scripts/nwui_configure.sh Specify the directory where the Java Standard Edition Runtime Environment (JRE) software is installed [/opt/nre/java/latest]: Specify the host name of the NetWorker Authentication Service host [nsr.amer.lan]: Specify the host name of the NetWorker Server to be Managed by NWUI [nsr.amer.lan]: Specify the AUTHC port for Networker Server which is managed by NWUI [9090]: The NetWorker Web UI Server requires a keystore file to configure encryption and to provide SSL support. EMC recommends that you specify a password that has a minimum of nine characters, with at least one upper case letter, one lower case letter, one number and one special character. The installation process will create a new keystore file. Specify the keystore password: HIDDEN_PASSWORD Confirm the password: HIDDEN_PASSWORD
    注意:啟動 NetWorker 服務後,可能需要幾分鐘才能處理好一切。可使用 nwui_configure.sh 指令檔可能會報告無法到達連接埠 9090 上的 AUTHC 伺服器。假設已使用預設連接埠 (9090),請等待幾分鐘,或執行 nwui_configure.sh 連接埠 9090 顯示為偵聽後: netstat -apno | grep :9090
    1. 啟動 NWUI 服務:
    systemctl start nwui
    1. 驗證服務是否已啟動:
    systemctl status networker
    systemctl status nwui


    伺服器應使用預設的自我簽署憑證 Networker 預設部署。

    受影響的產品

    NetWorker Family, NetWorker
    文章屬性
    文章編號: 000194900
    文章類型: How To
    上次修改時間: 20 8月 2026
    版本:  28
    向其他 Dell 使用者尋求您問題的答案
    支援服務
    檢查您的裝置是否在支援服務的涵蓋範圍內。