Linux FTP ProFtpd server configuration: setup timeouts

First step before making any changes to configuration files is to create backup:
# cp -fvp /etc/proftpd.conf /etc/proftpd.conf-2013-03-08.bak

Second step is to check service configuration to make sure it is correct.
# proftpd -td10
Checking syntax of configuration file

Syntax check complete.

Edit configuration file /etc/proftpd.conf: add timout directives inside <Global> </Global> section.
TimeoutNoTransfer 900
TimeoutStalled 600
TimeoutIdle 1200

Detaied options description below:

The TimeoutNoTransfer directive configures the maximum number of seconds a client is allowed to spend connected, after authentication, without issuing a command which results in creating an active or passive data connection (i.e. sending/receiving a file, or receiving a directory listing).

The TimeoutStalled directive sets the maximum number of seconds a data connection between the proftpd server and an FTP client can exist but have no actual data transferred (i.e. “stalled”). If the seconds argument is set to 0, data transfers are allowed to stall indefinitely (the default).

The TimeoutIdle directive configures the maximum number of seconds that proftpd will allow clients to stay connected without receiving any data on either the control or data connection. If data is received on either connection, the idle timer is reset. Setting TimeoutIdle to 0 disables the idle timer completely (clients can stay connected for ever, without sending data). This is generally a bad idea as a “hung” tcp connection which is never properly disconnected (the remote network may have become disconnected from the Internet, etc) will cause a child server to never exit (at least not for a considerable period of time) until manually killed.

Next step after making configuration changes is to check FTP service configuration again:
# proftpd -td10

Restart service.

1. If your ProFTPD server installed as part of xinetd:
# /sbin/service xinetd restart
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]

2. If your ProFTPD server installed as standard Linux service:
# /sbin/service proftpd restart
# /etc/init.d proftpd restart