有時您可能會想匯出憑證的公開與私密金鑰,以便後續可匯入憑證。例如,可能會想讓其他伺服器使用您的憑證。
此程序中的指令可用於含有萬用字元的憑證,例如 "cn=*,o=example"。
您可以使用 DSCC 執行此作業。如需相關資訊,請參閱目錄服務控制中心介面與 DSCC 線上說明。
匯出憑證。
$ dsadm export-cert [-o output-file] instance-path cert-alias |
例如:
$ dsadm export-cert -o /tmp/first-certificate /local/ds1 "First Certificate" $ dsadm export-cert -o /tmp/first-ca-server-certificate /local/ds1/ defaultCert Choose the PKCS#12 file password: Confirm the PKCS#12 file password: $ ls /tmp first-ca-server-certificate |
匯入憑證。
$ dsadm import-cert instance-path cert-file |
例如,若要將憑證匯入 host1 上的伺服器實例:
$ dsadm import-cert -h host1 /local/ds2 /tmp/first-ca-server-certificate Enter the PKCS#12 file password: |
(可選擇) 若已將憑證匯入伺服器,請配置伺服器以使用匯入的憑證。
$ dsconf set-server-prop -e -h host -p port -w - ssl-rsa-cert-name:server-cert |