CentOS7下vsftpd over SSL/TLS加密传输配置实践

简介: CentOS7下vsftpd over SSL/TLS加密传输配置实践

640.jpg

之前有介绍过CentOS下搭建vsftpd服务器,可以参考如下文章


CentOS7下搭建vsftpd服务器(本地用户模式)

下面开启SSL/TLS用于FTP安全加密传输


1、生成自签证书


cd /etc/pki/tls/certs/
openssl req -x509 -nodes -newkey rsa:2048 -keyout vsftpd.pem -out vsftpd.pem -days 365
[root@VM_Server ~]# cd /etc/pki/tls/certs/
[root@VM_Server certs]# ll
total 12
lrwxrwxrwx. 1 root root   49 Jan  4  2020 ca-bundle.crt -> /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
lrwxrwxrwx. 1 root root   55 Jan  4  2020 ca-bundle.trust.crt -> /etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt
-rwxr-xr-x. 1 root root  610 Oct 31  2018 make-dummy-cert
-rw-r--r--. 1 root root 2516 Oct 31  2018 Makefile
-rwxr-xr-x. 1 root root  829 Oct 31  2018 renew-dummy-cert
[root@VM_Server certs]# openssl req -x509 -nodes -newkey rsa:2048 -keyout vsftpd.pem -out vsftpd.pem -days 365 
Generating a 2048 bit RSA private key
................+++
...........................+++
writing new private key to 'vsftpd.pem'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:CN
State or Province Name (full name) []:ZheJiang
Locality Name (eg, city) [Default City]:HangZhou      
Organization Name (eg, company) [Default Company Ltd]:WalkingCloud
Organizational Unit Name (eg, section) []:IT
Common Name (eg, your name or your server's hostname) []:ftp.walkingcloud.cn
Email Address []:yuanfan@walkingcloud.cn
[root@VM_Server certs]# ll
total 16
lrwxrwxrwx. 1 root root   49 Jan  4  2020 ca-bundle.crt -> /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
lrwxrwxrwx. 1 root root   55 Jan  4  2020 ca-bundle.trust.crt -> /etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt
-rwxr-xr-x. 1 root root  610 Oct 31  2018 make-dummy-cert
-rw-r--r--. 1 root root 2516 Oct 31  2018 Makefile
-rwxr-xr-x. 1 root root  829 Oct 31  2018 renew-dummy-cert
-rw-r--r--  1 root root 3176 Aug  8 09:01 vsftpd.pem

640.png

然后拷贝证书


cd /etc/vsftpd/
cp /etc/pki/tls/certs/vsftpd.pem ./
chmod 600 vsftpd.pem


640.png

2、配置vsftpd.conf


vi /etc/vsftpd/vsftpd.conf 添加如下参数


# enable TLS
rsa_cert_file=/etc/vsftpd/vsftpd.pem
ssl_enable=YES
ssl_ciphers=HIGH
ssl_tlsv1=YES
ssl_sslv2=NO
ssl_sslv3=NO
force_local_data_ssl=YES
force_local_logins_ssl=YES

640.png


3、重启vsftpd服务,安装lftp客端工具测试


service vsftpd restart
yum install -y lftp
lftp -u yuanfan 192.168.31.80


640.png

640.png

640.png


4、windows下使用Filezilla FTP客户端连接

640.png

640.png

640.png

相关文章
|
6月前
|
应用服务中间件 Linux 网络安全
如何在 CentOS 7 上为 Nginx 创建自签名 SSL 证书
如何在 CentOS 7 上为 Nginx 创建自签名 SSL 证书
254 1
|
9月前
|
Linux 网络安全 开发工具
Centos6.5搭建一个简单的vsftpd服务
在CentOS 6.5上配置vsftpd服务器:确保与Win10能互通,更新yum源,安装vsftpd,编辑配置文件禁用匿名访问,重启服务并关闭防火墙。创建新用户和密码,通过FTP在Win10文件管理器中使用实验机IP访问,用创建的用户和密码登录,成功创建远程文件夹,实验机上可见。
120 2
|
9月前
|
Linux 网络安全 数据安全/隐私保护
Linux vsFTPd服务详解——文件加密传输配置
Linux vsFTPd服务详解——文件加密传输配置
263 2
|
2天前
|
安全 算法 网络协议
解析:HTTPS通过SSL/TLS证书加密的原理与逻辑
HTTPS通过SSL/TLS证书加密,结合对称与非对称加密及数字证书验证实现安全通信。首先,服务器发送含公钥的数字证书,客户端验证其合法性后生成随机数并用公钥加密发送给服务器,双方据此生成相同的对称密钥。后续通信使用对称加密确保高效性和安全性。同时,数字证书验证服务器身份,防止中间人攻击;哈希算法和数字签名确保数据完整性,防止篡改。整个流程保障了身份认证、数据加密和完整性保护。
|
3月前
|
安全 网络安全 数据安全/隐私保护
SSL/TLS证书**是一种用于加密网络通信的数字证书
SSL/TLS证书**是一种用于加密网络通信的数字证书
172 6
|
6月前
|
安全 Linux 网络安全
如何在 CentOS 7 上为 Apache 创建 SSL 证书
如何在 CentOS 7 上为 Apache 创建 SSL 证书
102 0
|
3月前
|
安全 网络协议 网络安全
【Azure 环境】从网络包中分析出TLS加密套件信息
An TLS 1.2 connection request was received from a remote client application, but non of the cipher suites supported by the client application are supported by the server. The connection request has failed. 从远程客户端应用程序收到 TLS 1.2 连接请求,但服务器不支持客户端应用程序支持的任何密码套件。连接请求失败。
111 2
|
3月前
|
存储 安全 数据安全/隐私保护
Docker中配置TLS加密的步骤
我们可以在 Docker 中成功配置 TLS 加密,增强 Docker 环境的安全性,保护容器之间以及与外界的通信安全。需要注意的是,在实际应用中,应根据具体情况进行更细致的配置和调整,确保符合安全要求。同时,定期更新证书和私钥,以保障安全性。
164 1
|
3月前
|
缓存 安全 算法
SSL和TLS部署实践
在TLS中,所有安全性都以服务器的加密身份开始,这就需要一个强大的私钥来防止攻击者进行模拟攻击。同样重要的是拥有一个有效和强大的证书,它会授予私钥来代表一个特定的主机名。
100 2
|
3月前
|
存储 安全 算法
SSL和TLS部署实践
【10月更文挑战第28天】在TLS中,服务器的加密身份和强大私钥是安全基础,2048位RSA密钥足以满足大多数需求。保护私钥需在可信环境生成、加密存储、使用HSM、及时撤销旧证书、每年更新证书。确保证书覆盖所有域名,选择可靠CA,使用SHA256签名算法,配置完整证书链,禁用不安全加密套件,启用前向保密,使用会话重用机制,启用OCSP Stapling,加密整个网站,删除混合内容,安全设置Cookie,配置HSTS和CSP。
368 1