我收到了一些来自代理的请求,这些请求的主机名不正确。我已更正此问题,但仍有未解决的请求,这些请求的主机名不正确。
我试过:
$puppet cert list
"wrong.host.name" (SHA256) 8E:...:51
$ puppet cert revoke wrong.host.name
Error: Could not find a serial number for wrong.host.name
$ puppet cert clean wrong.host.name
Error: Could not find a serial number for wrong.host.name
摆脱它们的正确方法是什么?
答案1
使用ca
效果更好,并且可以像 一样通过一个步骤删除证书cert
。重要的是,它不会让您暂时签署无效证书。
$ puppet ca destroy wrong.host.name
Notice: Removing file Puppet::SSL::CertificateRequest wrong.host.name at '/var/lib/puppet/ssl/ca/requests/wrong.host.name.pem'
Deleted for wrong.host.name: Puppet::SSL::CertificateRequest
命令puppet ca
最近已被弃用因此在某个时候它可能会消失,但没有等效的命令。有一个漏洞提交,如果您认为删除此命令而不进行替换有点愚蠢,您可以投票支持。
答案2
可能的解决方案1:
使用puppet cert clean
puppet master 是正确的方法。但是,由于您收到错误,因此您可能拥有错误的证书清单。
尝试重新清点然后清理:
$ puppet cert reinventory
$ puppet cert clean --all
注意:我的示例使用了--all
标志,这将清除所有证书(已签名和未签名)。另外,请注意,在运行之前应停止 Puppet Master reinventory
。
来源:http://docs.puppetlabs.com/references/3.6.2/man/cert.html
可能的解决方案2:
$ puppet cert sign wrong.host.name
Notice: Signed certificate request for wrong.host.name
Notice: Removing file Puppet::SSL::CertificateRequest wrong.host.name at '/var/lib/puppet/ssl/ca/requests/wrong.host.name.pem'
$ puppet cert clean wrong.host.name
Notice: Revoked certificate with serial 87
Notice: Removing file Puppet::SSL::Certificate wrong.host.name at '/var/lib/puppet/ssl/ca/signed/wrong.host.name.pem'
Notice: Removing file Puppet::SSL::Certificate wrong.host.name at '/var/lib/puppet/ssl/certs/wrong.host.name.pem'
可能的解决方案3:
第一:在服务器上
$ puppet cert --revoke wrong.host.name
$ puppet cert --clean wrong.host.name
第二:在客户端
$ rm -rf /usr/lib/puppet/ssl
$ puppet agent --server [puppetmaster domain name] --waitforcert 60
第三:在服务器上(根据需要调整)
$ puppet cert --list (you should see your host)
$ puppet cert --sign wrong.host.name
另外,请仔细检查您的客户端是否可以访问您的 [puppetmaster 域名]。
答案3
这是我的做法
[root@puppetmc ca]# puppet cert clean sparrow.home
Error: Could not find a serial number for sparrow.home
[root@puppetmc ca]# cat inventory.txt
0x0002 2015-05-17T06:33:29GMT 2020-05-16T06:33:29GMT /CN=puppetmc.home
0x0003 2015-05-17T23:25:33GMT 2020-05-16T23:25:33GMT /CN=sparrow.rospop.com
0x0004 2015-05-18T00:53:18GMT 2020-05-17T00:53:18GMT /CN=puppetmc.home
0x0005 2015-05-18T02:18:12GMT 2020-05-17T02:18:12GMT /CN=sparrow.rospop.com
[root@puppetmc ca]# vi inventory.txt
将以下行添加到 inventory.txt 中:
0x0001 2015-05-17T06:33:29GMT 2020-05-16T06:33:29GMT /CN=sparrow.home
然后运行
[root@puppetmc ca]# puppet cert clean sparrow.home
Notice: Revoked certificate with serial 1
Notice: Removing file Puppet::SSL::CertificateRequest sparrow.home at '/var/lib/puppet/ssl/ca/requests/sparrow.home.pem'
Vince Bhebhe