Search The Hostwinds Guides Knowledge Base

Install ProFTPD (Debian 9)

Share This Article [TheChamp-Sharing]

This guide will walk you through ProFTPd server installation and configuration, showing you how to customize your FTP server’s actions by walking you through ProFTPd configuration.  

How To Install ProFTPd On Debian 9

Step 1: SSH into your Debian Installation 

Step 2 : Install Updates

apt-get update

Step 3: Install Proftpd

apt-get install proftpd

 

How To Configure Virtual Users and Directories

Step 1: First, we need to add a line to the /etc/shells file

nano /etc/shells

Step 2: Then add the following line at the bottom

/bin/false

Step 3: Create the FTP directory

cd /home
mkdir /home/FTP

The FTP directory can be called anything you wish, but for now, we will call it FTP

Step 4: Create the directory for your virtual user

mkdir /home/FTP/<username>

Replace <username> with what you would like your virtual user to be called

Step 5: Create the FTP virtual user

useradd <username> -p <password> -d /home/FTP/<username> -s /bin/false

Replace <username> with what you would like your virtual user to be called and replace <password> with your desired password

Step 6: Make sure to change the permissions of the file to 777

chmod 777 FTP

How To Configure The ProFTPd Config File To Lock Each User In Their Directory

If you’re going to have multiple users, don’t forget to add those directories into the FTP directory. 

Step 1: Setting the DefaultRoot directory

nano /etc/proftpd/proftpd.conf

Step 2: Uncomment the DefaultRoot option. It will look like this at first

#DefaultRoot                                 ~

Set it to this 

DefaultRoot                                  /home/FTP

Step 3: Set the directory per  virtual user, at the bottom of this configuration file, add these lines.

<Directory /home/FTP/<username>

  <Limit ALL>

    DenyALL

  </Limit>

  <Limit DIRS READ WRITE>

    AllowUser <username>

  </Limit>

</Directory>

<Directory /home/FTP/<username>

  <Limit ALL>

    DenyALL

  </Limit>

  <Limit DIRS READ WRITE>

    AllowUser <username>

  </Limit>

</Directory>

Be sure to do this with each user

Be sure to replace <username> with the user(s) you created previously

Step 4: Starting the ProFTPd service

/etc/init.d/proftpd start

 

Related Articles