第 18 章 停用执行 CA 续订服务器和 CRL 发布者角色的服务器
您可能有一台服务器同时执行证书颁发机构(CA)续订服务器角色和证书吊销列表(CRL)发布者角色。如果您需要将此服务器下线或停用,请选择并配置另一台 CA 服务器来执行这些角色。
在本例中,主机 server.idm.example.com
,其履行 CA 续订服务器和 CRL 发布者角色,必须停用。此流程将 CA 续订服务器和 CRL 发布者角色转移到主机 replica.idm.example.com
,并从 IdM 环境中删除 server.idm.example.com
。
您不需要配置同一服务器来执行 CA 续订服务器和 CRL 发布者角色。
先决条件
- 您有 IdM 管理员凭证。
- 您有要停用的服务器的 root 密码。
- 在您的 IdM 环境中至少有两个 CA 副本。
流程
获取 IdM 管理员凭证:
[user@server ~]$ kinit admin Password for admin@IDM.EXAMPLE.COM:
可选:如果您不确定哪些服务器执行 CA 续订服务器和 CRL 发布者角色:
显示当前的 CA 续订服务器。您可以从任何 IdM 服务器运行以下命令:
[user@server ~]$ ipa config-show | grep 'CA renewal' IPA CA renewal master: server.idm.example.com
测试主机是否为当前的 CRL 发布者。
[user@server ~]$ ipa-crlgen-manage status CRL generation: enabled Last CRL update: 2019-10-31 12:00:00 Last CRL Number: 6 The ipa-crlgen-manage command was successful
不生成 CRL 的 CA 服务器显示
CRL generation: disabled
。[user@replica ~]$ ipa-crlgen-manage status CRL generation: disabled The ipa-crlgen-manage command was successful
继续在 CA 服务器上输入此命令,直到找到 CRL 发布者服务器。
显示您可以提升的所有其他 CA 服务器,以履行这些角色。此环境有两个 CA 服务器。
[user@server ~]$ ipa server-role-find --role 'CA server' ---------------------- 2 server roles matched ---------------------- Server name: server.idm.example.com Role name: CA server Role status: enabled Server name: replica.idm.example.com Role name: CA server Role status: enabled ---------------------------- Number of entries returned 2 ----------------------------
将
replica.idm.example.com
设为 CA 续订服务器。[user@server ~]$ ipa config-mod --ca-renewal-master-server replica.idm.example.com
在
server.idm.example.com
上:禁用证书更新器任务:
[root@server ~]# pki-server ca-config-set ca.certStatusUpdateInterval 0
重启 IdM 服务:
[root@server ~]# ipactl restart
在
replica.idm.example.com
上:启用证书更新器任务:
[root@replica ~]# pki-server ca-config-unset ca.certStatusUpdateInterval
重启 IdM 服务:
[root@replica ~]# ipactl restart
在
server.idm.example.com
上,停止生成 CRL。[user@server ~]$ ipa-crlgen-manage disable Stopping pki-tomcatd Editing /var/lib/pki/pki-tomcat/conf/ca/CS.cfg Starting pki-tomcatd Editing /etc/httpd/conf.d/ipa-pki-proxy.conf Restarting httpd CRL generation disabled on the local host. Please make sure to configure CRL generation on another master with ipa-crlgen-manage enable. The ipa-crlgen-manage command was successful
在
replica.idm.example.com
上,开始生成 CRL。[user@replica ~]$ ipa-crlgen-manage enable Stopping pki-tomcatd Editing /var/lib/pki/pki-tomcat/conf/ca/CS.cfg Starting pki-tomcatd Editing /etc/httpd/conf.d/ipa-pki-proxy.conf Restarting httpd Forcing CRL update CRL generation enabled on the local host. Please make sure to have only a single CRL generation master. The ipa-crlgen-manage command was successful
停止
server.idm.example.com
上的 IdM 服务:[root@server ~]# ipactl stop
在
replica.idm.example.com
上,从 IdM 环境中删除server.idm.example.com
。[user@replica ~]$ ipa server-del server.idm.example.com
在
server.idm.example.com
上,以 root 帐户身份使用ipa-server-install --uninstall
命令:[root@server ~]# ipa-server-install --uninstall ... Are you sure you want to continue with the uninstall procedure? [no]: yes
验证
显示当前的 CA 续订服务器。
[user@replica ~]$ ipa config-show | grep 'CA renewal' IPA CA renewal master: replica.idm.example.com
确认
replica.idm.example.com
主机正在生成 CRL。[user@replica ~]$ ipa-crlgen-manage status CRL generation: enabled Last CRL update: 2019-10-31 12:10:00 Last CRL Number: 7 The ipa-crlgen-manage command was successful