Image

(Last change: 22.04.2024)

Debian 12 Linux FTP Server (ProFtpd + Apache)

Sometimes there are tasks when you urgently need to transfer a large amount of data via the Internet, often these are large video files, in free cloud services, as a rule, there is a limit on the size of 1 file no more than 10 GB, and there is absolutely no time to create an ftp server. We have created a ready-made FTP server configuration based on ProFTPD. The server operates in two modes, active and passive, which gives more connectivity options. Also, in order to be able to send a link to the hosted file through the browser, we set up the Apache service, which looks at the root of the ftp directory.


The preconfigured server configuration is available on the order form.

Update packages:

apt update -y  
apt upgrade -y

Install services:

apt install proftpd -y
apt install apache2 -y


Run and configure autorun:

systemctl start proftpd
systemctl start apache2
systemctl enable proftpd
systemctl enable apache2

Let's check the status:

ss -antpl | grep proftpd


Create an ftp user and set a password:

adduser ftpuser
passwd ftpuser


Let's make the necessary settings:

Let's add a directive to lock users in the home directory

/etc/proftpd/proftpd.conf

DefaultRoot ~

Add the configuration to the very end of the file

/etc/proftpd/proftpd.conf


  Umask 022
  AllowOverwrite on
 
    AllowUser ftpuser
    DenyAll  
 
 
    AllowUser ftpuser
    DenyAll
 

Restart the service to apply the settings: 

systemctl restart proftpd

Let's make the apache2 service look at the root directory of the user we created. This functionality will be useful if you need to share a file with a link using the http protocol. Specify the new path /home/ instead of the old /var/www/:

vi /etc/apache2/apache2.conf 

Options Indexes FollowSymLinks
AllowOverride None
Require all granted

Let's restart the service:

systemctl restart apache2

If necessary and have an SSL certificate, we will place the CRT and KEY files 

chmod 600 /etc/ssl/private/proftpd.key 
chmod 600 /etc/ssl/certs/proftpd.crt

Let's add a configuration file: 

/etc/proftpd/proftpd.conf

Include /etc/proftpd/tls.conf

Let's check the configuration and bring it to the form:

/etc/proftpd/tls.conf 

TLSRSACertificateFile /etc/ssl/certs/proftpd.crt
TLSRSACertificateKeyFile /etc/ssl/private/proftpd.key
TLSEngine on
TLSLog /var/log/proftpd/tls.log
TLSProtocol SSLv23
TLSRequired on
TLSOptions NoCertRequest EnableDiags NoSessionReuseRequired
TLSVerifyClient off

Let's restart the service:

systemctl restart proftpd

The FTP server is ready to go.

If necessary, you can add file access protection via http with a password, for this, use this guide:




No Comments Yet