linux - 从letsencrypt生成ssl时出错

标签 linux ubuntu ssl lets-encrypt

关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。












我们不允许在 Stack Overflow 上提出有关通用计算硬件和软件的问题。您可以编辑问题,使其成为 on-topic对于堆栈溢出。


1年前关闭。







Improve this question




您好正在学习如何安装让我们使用 certbot 在 ubuntu 18.04 中加密证书。
我已经安装了 certbot

sudo snap install --beta --classic certbot
给予许可
sudo snap set certbot trust-plugin-with-root=ok
因为我使用aws ec2所以我运行
sudo snap install --beta certbot-dns-route53
现在,我正在运行命令
/snap/bin/certbot certonly \
  --dns-route53 \
  -d *.example.com
我收到错误:
Unable to locate credentials
To use certbot-dns-route53, configure credentials as described at https://boto3.readthedocs.io/en/latest/guide/configuration.html#best-practices-for-configuring-credentials and add the necessary permissions for Route53 access.
我是在 vps 中安装 SSL 证书的新手。请告知如何生成证书以安装通配符。

最佳答案

是的。错误很明显,您需要 Amazon Web Services Route 53 API 才能通过创建并随后删除 TXT 记录来完成 dns-01 质询 (DNS01),并且此插件需要包含 Amazon Web Services API 凭证的配置文件,用于具有以下内容的帐户权限:

route53:ListHostedZones
route53:GetChange
route53:ChangeResourceRecordSets
您可以获得可以在如下 AWS 策略中捕获的这些权限。
{
    "Version": "2012-10-17",
    "Id": "certbot-dns-route53 sample policy",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "route53:ListHostedZones",
                "route53:GetChange"
            ],
            "Resource": [
                "*"
            ]
        },
        {
            "Effect" : "Allow",
            "Action" : [
                "route53:ChangeResourceRecordSets"
            ],
            "Resource" : [
                "arn:aws:route53:::hostedzone/YOURHOSTEDZONEID"
            ]
        }
    ]
}
最后,您可以为 AWS route 53 插件设置配置配置文件
或者通过
使用 AWS_ACCESS_KEY_ID 和 AWS_SECRET_ACCESS_KEY 环境变量。或者
在默认位置 ~/.aws/config 使用凭证配置文件。或者
在使用提供的路径中使用凭据配置文件
AWS_CONFIG_FILE 环境变量。
示例配置文件是:
[default]
aws_access_key_id=AKIAIOSFODNN7EXAMPLE
aws_secret_access_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
您可以进一步阅读 https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/access-control-overview.html
https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/r53-api-permissions-ref.html
https://boto3.readthedocs.io/en/latest/guide/configuration.html#best-practices-for-configuring-credentials

关于linux - 从letsencrypt生成ssl时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63739238/

相关文章:

php - 使用 PHP 通过 SSL 从 Linux 为 iOS 应用程序推送通知

php - 除了证书,我还需要什么 SSL?

linux - 如何在 t1.micro 实例上更新 AWS RHEL 6.4 AMI 上的 curl

apache - 403 Forbidden 您无权访问/文件夹名称/在此服务器上

ubuntu - 有没有人在 Ubuntu 16.04 LTS 上安装 QGIS

java - 如何在 Ubuntu Linux 上安装 JDK

asp.net - 启用 SSL 时将 login.aspx 放在哪里

linux - pscp中的“ignoring potentially dangerous server-supplied filename”

python - 将 RGB 图像转换为六色/CIELAB/CIE XYZ

javascript - 如何在这里实现最大的网络安全