How to setup your own FTP Server quick and easy.

Sep 26, 2006 06:37 GMT  ·  By

ProFTPD is a stable, secure and highly configurable GPL-licensed FTP server capable of serving large files over a local network or the Internet. It has all the features a FTP server should have and even more. This File Transfer Protocol Daemon supports hidden directories, virtual hosts and per-directory ".ftpaccess" files. Advanced features like multiple authentication methods and upload/download ratios are also supported. It uses a single main configuration file which has a syntax similar to Apache and it's also able to work over Ipv6.

Installation

For security reasons, you shouldn't install ProFTPD using the root account but rather using an unprivileged user account so, first of all, you should create a separate user and usergroup by executing the following commands (as root):

groupadd -g 46 proftpd && useradd -c proftpd -d /srv/ftp -g proftpd -s /usr/bin/proftpdshell -u 46 proftpd && install -v -d -m775 -o proftpd -g proftpd /srv/ftp && ln -v -s /bin/false /usr/bin/proftpdshell && echo /usr/bin/proftpdshell >> /etc/shells

Next, switch to an unprivileged user (the one you regularly use) and download the latest ProFTPD package, uncompress it, change to the new created directory and execute the following commands:

./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/run && make

After both processes are completed (without errors), switch back to root account and execute the command:

make install

This command will install ProFTPD binaries and files to their assigned directories.

Configuration

As I've said before, ProFTPD is configured through a single configuration file, which resides in /etc and it's named proftpd.conf. So, load it up in a text editor and make the appropriate changes. Here is an example configuration file with every syntax explained:

# This is a basic ProFTPD configuration file # It establishes a single server and a single anonymous login.

ServerName "ProFTPD Default Installation" ServerType standalone DefaultServer on

# Port 21 is the standard FTP port. Port 21 # Umask 022 is a good standard umask to prevent new dirs and files # from being group and world writable. Umask 022

# To prevent DoS attacks, set the maximum number of child processes # to 30. If you need to allow more than 30 concurrent connections # at once, simply increase this value. Note that this ONLY works # in standalone mode, in inetd mode you should use an inetd server # that allows you to limit maximum number of processes per service # (such as xinetd) MaxInstances 30

# Set the user and group that the server normally runs at. User proftpd Group proftpd

# Normally, files should be overwritable.

AllowOverwrite on

# A basic anonymous configuration, no upload directories. If you do not # want anonymous users, simply delete the entire section.

User proftpd Group proftpd # Clients should be able to login with "anonymous" as well as "proftpd" UserAlias anonymous proftpd

# Limit the maximum number of anonymous logins MaxClients 10

# 'welcome.msg' should be displayed at login, and '.message' displayed # in each newly chdired directory. DisplayLogin welcome.msg DisplayFirstChdir .message

# Limit WRITE everywhere in the anonymous chroot

DenyAll

Running ProFTPD

After the configuration file has been edited to suit your needs, it's time to fire up ProFTPD for the first time. This is done by executing the following command:

proftpd -c /etc/proftpd.conf

ProFTPD comes with some extra binary files, each which its own purpose:

ftpcount: Shows the current number of connections. ftpshut: Shuts down all ProFTPD servers at a given time. ftptop: Displays running status on connections. ftpwho: Shows current process information for each session.