---
title: "CentOS 6、7 生成Let's Encrypt 安全证书"
author: "喧嚣求静"
date: "2017-08-16T15:30:55Z"
tags: []
categories: ["互联网"]
slug: "centos-6-7-let-s-encrypt"
draft: false
lastmod: "2017-08-16T15:30:55Z"
id: 2389909
url: "https://913.iteye.com/blog/2389909"
---

[Let's Encrypt](https://www.vpser.net/build/letsencrypt-certbot.html)是很火的一个免费SSL证书发行项目，自动化发行证书，证书有90天的有效期。适合个人使用或者临时使用，不用再忍受自签发证书不受浏览器信赖的提示。去年VPS侦探曾经说过[Let's Encrypt的使用教程](https://www.vpser.net/build/letsencrypt-free-ssl.html)，但是Let's Encrypt已经发布了新的工具[certbot](https://www.vpser.net/build/letsencrypt-certbot.html)，虽然是新的工具，但是生成证书的使用方法和参数是基本一致的，证书续期更简单了。但是目前看[certbot](https://www.vpser.net/build/letsencrypt-certbot.html)在一些老版本的Linux发行版上的兼容性还是有问题的，特别是在CentOS 5上因为python版本过低是无法用的，CentOS 6上需要先[安装epel](https://www.vpser.net/manage/centos-rhel-linux-third-party-source-epel.html)才行，当然也有很多第三方的工具你也可以自己去尝试一下。

### 安装方法：

如果是CentOS 6、7，先执行：**yum install epel-release**

```
cd /root/
wget https://dl.eff.org/certbot-auto --no-check-certificate
chmod +x ./certbot-auto
./certbot-auto -n
```

./certbot-auto -n只是用来安装依赖包的，也可以跳过直接到下面的生成证书的步骤，国内VPS或服务器上使用的话建议先[修改为国内的pip源](https://www.vpser.net/build/letsencrypt-certbot.html#pip.conf)。

 

参考来源：

https://www.vpser.net/build/letsencrypt-certbot.html

https://diamondfsd.com/article/e221b455-b0e7-40b7-a6c7-9bb7e3e35657