FTP Server setup with TLS (Transport Layer Security) on Debian

简介: ProFTPD is a ftp server written for use on Unix and Unix-a-like operating systems, there is no support for native use under Microsoft Windows.
ProFTPD is a ftp server written for use on Unix and Unix-a-like operating systems, there is no support for native use under Microsoft Windows.

The TLS protocol allows applications to communicate across a network

in a way designed to prevent eavesdropping, tampering, and message forgery. TLS provides endpoint authentication and communications privacy over the Internet using cryptography. Typically, only the server is authenticated (i.e., its identity is ensured) while the client remains unauthenticated.

FTP is a very insecure protocol because all passwords and all data are transferred in clear text. By using TLS, the whole communication can be encrypted, thus making FTP much more secure. This article explains how to set up ProFTPd with TLS on a Debian Etch server.

Install ProFTPd And OpenSSL

#apt-get install proftpd openssl

You will be asked a question:

Run proftpd from inetd or standalone? <-- standalone

This will complete the installation.

Configuring proftpd

Now you need to open /etc/proftpd/proftpd.conf and change UseIPv6 from on to off; otherwise you’ll get a warning like this when you start ProFTPd

#vi /etc/proftpd/proftpd.conf

UseIPv6 off

For security reasons you can add the following lines to /etc/proftpd.conf

DefaultRoot ~
IdentLookups off
ServerIdent on “Secure FTP Server

and restart Proftpd using the following command

#/etc/init.d/proftpd restart

Creating The SSL Certificate For TLS

In order to use TLS, we must create an SSL certificate. I create it in /etc/proftpd/ssl, therefore I create that directory first:

#mkdir /etc/proftpd/ssl

Afterwards, we can generate the SSL certificate as follows:

#openssl req -new -x509 -days 365 -nodes -out /etc/proftpd/ssl/proftpd.cert.pem -keyout /etc/proftpd/ssl/proftpd.key.pem

Country Name (2 letter code) [AU]: <-- Enter your Country Name (e.g., "GB").

State or Province Name (full name) [Some-State]: <-- Enter your State or Province Name.

Locality Name (eg, city) []: <-- Enter your City.

Organization Name (eg, company) [Internet Widgits Pty Ltd]: <-- Enter your Organization Name (e.g., the name of your company).

Organizational Unit Name (eg, section) []: <-- Enter your Organizational Unit Name (e.g. "IT Department").

Common Name (eg, YOUR name) []: <-- Enter the Fully Qualified Domain Name of the system (e.g. "test.example.com").

Email Address []: <-- Enter your Email Address.

Enabling TLS In ProFTPd

In order to enable TLS in ProFTPd, open /etc/proftpd/proftpd.conf and find the section beginning with

<IfModule mod_tls.c>

vi /etc/proftpd/proftpd.conf

It should look like this:

<IfModule mod_tls.c>
TLSEngine off
</IfModule>

Modify it as follows

<IfModule mod_tls.c>
TLSEngine on
TLSLog /var/log/proftpd/tls.log
TLSProtocol SSLv23
TLSOptions NoCertRequest
TLSRSACertificateFile /etc/proftpd/ssl/proftpd.cert.pem
TLSRSACertificateKeyFile /etc/proftpd/ssl/proftpd.key.pem
TLSVerifyClient off
TLSRequired on
</IfModule>

If you use TLSRequired on, then only TLS connections are allowed (this locks out any users with old FTP clients that don’t have TLS support); by commenting out that line or using TLSRequired off both TLS and non-TLS connections are allowed, depending on what the FTP client supports.

Restart ProFTPd using the following command

/etc/init.d/proftpd restart

That’s it. You can now try to connect using your FTP client; however, you should configure your FTP client to use TLS (this is a must if you use TLSRequired on).

If you’re having problems with TLS, you can take a look at the TLS log file /var/log/proftpd/tls.log.

目录
相关文章
|
网络协议 文件存储 Windows
Windows Server 2019 FTP服务器搭建
Windows Server 2019 FTP服务器搭建
402 0
|
存储 关系型数据库 MySQL
手把手教教会你使用Wing FTP Server安装配置并结合内网穿透实现公网访问本地站点
手把手教教会你使用Wing FTP Server安装配置并结合内网穿透实现公网访问本地站点
|
网络协议 Unix 网络安全
FTP服务器怎么搭建?Windows server搭建FPT服务器
FTP服务器是按照FTP协议提供文件传输服务的计算机。它用于在两台计算机间安全地传输文件,支持用户权限管理和跨平台操作。FTP使用控制连接处理命令,数据连接传输文件,有PORT和PASV模式。要搭建FTP服务器,首先在Windows Server 2008 R2上安装IIS,确保选中FTP服务。接着,创建FTP文件夹作为站点根目录,通过IIS管理器添加FTP站点,配置站点信息、身份验证和权限。测试客户端通过telnet和浏览器访问FTP服务器,确认能成功登录及浏览文件。FTP常用于文件共享和管理,可通过专用工具如FlashFXP上传下载文件。
637 0
FTP服务器怎么搭建?Windows server搭建FPT服务器
|
存储 负载均衡 Java
nginx+ftp搭建图片服务器(Windows Server服务器环境下)
nginx+ftp搭建图片服务器(Windows Server服务器环境下)
908 0
|
弹性计算 安全 前端开发
阿里云ECS服务器配置Web项目和FTP Server
第一次使用阿里云ECS服务器部署Web项目和FTP Server,在使用过程中遇到了很多困难,但同时对计算机网络的工作原理有了更加清晰的认识。现将使用经历进行系统性地总结。 在阅读之前请确保已购买阿里云ECS云服务器并且初始化云服务器操作系统,本教程选用的操作系统为“Windows Server 2022 数据中心版 64位中文版”。
458 0
|
Windows
阿里云Windows Server 2012 R2服务器搭建FTP服务器(被动模式)
阿里云Windows Server 2012 R2服务器搭建FTP服务器(被动模式)
965 0
阿里云Windows Server 2012 R2服务器搭建FTP服务器(被动模式)
|
存储 前端开发 对象存储
如何基于云存储网关SMB共享搭建FileZilla FTP server
本文介绍在windows 环境下,如何利用云存储网关提供的SMB共享,使用FileZilla Server搭建FTP服务器来访问对象存储(OSS)中的资源。
2937 0
如何基于云存储网关SMB共享搭建FileZilla FTP server
|
网络安全 Windows
Windows 技术篇-使用Windows Server 2012 R2服务器设置ftp共享文件路径实例演示
Windows 技术篇-使用Windows Server 2012 R2服务器设置ftp共享文件路径实例演示
932 0
Windows 技术篇-使用Windows Server 2012 R2服务器设置ftp共享文件路径实例演示
|
Windows
推荐一款ftp server工具
推荐一款ftp server工具
250 0
|
弹性计算 网络协议 网络安全
FTP Server Over 阿里云 最佳实践
作为非常古老的协议(1971年首次提出,1980年首次应用),FTP在目前依然占有一席之地,但是由于目前IT业发展的非常迅猛,它和现在的基础架构产生了一些水土不服,本文旨在通过日常常见的案例,来介绍如何在阿里云上搭建FTP Server和FTP Client。
6560 0