We use cookies
We use cookies to optimize our website. By continuing to browse the site, you agree to our use of cookies.
Control panel
  • Русский
  • Українська
  • English
  • UAH
  • USD
  • RUB
  • EUR
  • 0-800-307-307 Hotline
  • +38 (044) 392-74-33 Kiev
  • +38 (057) 728-39-00 Kharkiv
  • +38 (056) 794-38-31 Dnipro
  • +38 (032) 229-58-93 Lviv
  • +38 (048) 738-57-70 Odessa
  • +38(093) 170-15-42  Life
  • +38 (067) 400-88-44 Kievstar
  • +1(888)393-24-51  USA, Toll free
  • +44(131)507-01-14  Great Britain
  • +7 (499) 348-28-61 Moscow

4.4.13. Installing ProFTPd

To be able to work with the server by FTP, you need to install and configure special software on the server - an FTP server. One of the most popular and convenient FTP-servers is ProFTPd.

For installation FTP-server you need to connect to the server by SSH or VNC, install the program and edit the configuration files. Different distributions perform these operations differently:

  1. Install the EPEL repository:
    yum install epel-release
  2. Install ProFTPd:
    yum install proftpd
  3. Open ports to work FTP:
    firewall-cmd --permanent --add-port=20-21/tcp
    firewall-cmd --permanent --add-port=40900-40999/tcp 
    firewall-cmd --reload
  4. Set ProFTPd to start at system startup and run it:
    systemctl enable proftpd
    systemctl start proftpd
  5. Change configuration file ProFTPd.
  6. You can add a user with the command:
    useradd example -d /var/www -s /sbin/nologin
    passwd example

    Enter the required data:

    • Instead example provide username FTP-user.
    • Instead /var/www specify home directory FTP-user.
    • After execution passwd example you will need to enter your password twice FTP-user.
To install and configure ProFTPd, follow these steps:
  1. Install the program using the command:
    apt-get install proftpd
  2. Change configuration file ProFTPd.
  3. Run the command:
    echo "/bin/false" >> /etc/shells
  4. Add user for access by FTP using the command:
    adduser --home /home/example --shell /bin/false example

    Instead of a directory /home/example as the home directory, you can specify the directory /var/www.

    1. After adding a user, you need to assign him the rights to edit files located in certain directories. It is best to restrict access to site files only by running the command:
      chown example -R /var/www
      • example - specify the created user earlier.
      • /var/www - specify the directory for which the access rights are changed. Note It is worth specifying the directory where the site files are located to be able to edit them (by default, this /var/www).
To install and configure ProFTPd, follow these steps:
  1. Run the command:
    emerge --ask net-ftp/proftpd
  2. Copy the config file if it doesn't exist using the command:
    cp /etc/proftpd/proftpd.conf.distrib /etc/proftpd/proftpd.conf
  3. Change configuration file ProFTPd.
  4. Set ProFTPd to start at system startup and run it:
    1. For OpenRC you need to run:
      rc-update add proftpd default 
      rc-service proftpd start
    2. For systemd:
      systemctl enable proftpd
      systemctl start proftpd
  5. Add user for access by FTP using the command:
    adduser --home /home/example --shell /bin/false example 

    Instead of a directory /home/example as the home directory, you can specify the directory /var/www.

    1. After adding a user, you need to assign him the rights to edit files located in certain directories. It is best to restrict access to site files only by running the command:
      chown example -R /var/www
      • example - specify the user created earlier.
      • /var/www - specify the directory for which the access rights are changed. Note It is worth specifying the directory where the site files are located to be able to edit them (by default, this /var/www).
To install and configure ProFTPd, follow these steps:
  1. Install the server by running the command:
    dnf -y install proftpd 
  2. Change the ProFTPd configuration file (unlike other operating systems, it is located in /etc/proftpd.conf). At the end of the file add the line:
    PassivePorts 21000 21020
  3. Set ProFTPd to start at system startup and run it:
    systemctl enable proftpd
    systemctl start proftpd
  4. Configure SElinux (if present) and firewall by running the commands:
    setsebool -P ftp_home_dir=1
    setsebool -P allow_ftpd_full_access=1
    # Firewall settings
    firewall-cmd --permanent --add-port=21/tcp
    firewall-cmd --add-port=21000-21020/tcp --permanent
    firewall-cmd --reload
  5. Create a user with:
    useradd example -d /var/www -s /sbin/nologin
    passwd example

    Enter the required data:

    • Instead example provide a username.
    • Instead /var/www specify the home directory.
    • After execution passwd example you will need to enter the password for the user twice.
  1. Edit the config file FTP-servers:
    nano /etc/proftpd/proftpd.conf

    Change the lines:

    • ServerName - specify the server name.
    • ServerType - specify the launch mode:
      • standalone - automatic start at system startup (default mode).
      • inetd - exclusively manual start.
    • # DefaultRoot - remove the symbol # at the beginning of the line. This parameter specifies access to the default directory. To determine the default access to the user's directory, you need to specify the value ~.
    • Add the line UseReverseDNS off before the line # Use this to jail all users in their homes (default line 34).
    • Check the configuration file for correctness after saving by running:
      proftpd -t
  2. Restart ProFTPd server:
    /etc/init.d/proftpd restart