gpt4 book ai didi

ssl - AWS 上的 Chef : How do you update the certificate on the server?

转载 作者:太空宇宙 更新时间:2023-11-03 13:03:25 24 4
gpt4 key购买 nike

我正在尝试使用笔记本电脑上的 knife 连接到托管在 AWS 上的新配置的 Chef 服务器。我知道下面列出的内容对我来说是正确的方向,但我不确定具体如何去做。

If you are not able to connect to the server using the hostname ip-xx-x-x-xx.ec2.internal 
you will have to update the certificate on the server to use the correct hostname.

最佳答案

我遇到了同样的问题。问题是 EC2 实例将其私有(private) ip 放入其主机名文件中。这导致 Chef 自行将证书分配给内部 ip。当您执行 knife ssl check 时,您可能会收到如下所示的错误消息:

ERROR: The SSL cert is signed by a trusted authority but is not valid for the given hostname
ERROR: You are attempting to connect to: 'ec2-x-x-x-x.us-west-2.compute.amazonaws.com'
ERROR: The server's certificate belongs to 'ip-y-y-y-y.us-west-2.compute.internal'

连接到公共(public) IP 是正确的,但是如果您没有将 Chef 服务器配置为在签署证书时使用公共(public) DNS,您将继续收到此错误。

编辑: Chef 的文档曾经包含纠正此问题的步骤,但自从我最初回答此问题后,他们已从教程中删除了这些步骤。以下步骤适用于 ec2 实例上的 Chef 12、Ubuntu 16。

  1. ssh 到您的 Chef 服务器
  2. 使用以下命令打开主机名文件 sudo vim/etc/hostname
  3. 删除包含您的内部 ip 的行并将其替换为您的公共(public) ip 并保存文件。
  4. 使用 sudo reboot 重启服务器
  5. 运行 sudo chef-server-ctl reconfigure(这会签署新证书等)
  6. 返回您的工作站并使用 knife ssl fetch,然后使用 knife ssl check,您应该可以开始了。

您还可以做的是,在将 Chef 安装到服务器之前完成步骤 1 - 4。

关于ssl - AWS 上的 Chef : How do you update the certificate on the server?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30987791/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com