(dv):FTP connection limits
- This page was last modified on November 30, 2010, at 18:32.
From (mt) Community Wiki
Results
You will limit the number of simultaneous FTP connections to your server. By default, the number of simultaneous FTP connections is unlimited.
This article shows how to make high-level configuration changes to your server. (mt) Media Temple does not support custom server configurations for the (dv) Dedicated-Virtual Server. We suggest that you back up your server before making configuration changes.
Instructions
- Log into your server with a root or sudo user via SSH.
- Open your FTP configuration file for editing:
vi /etc/proftpd.conf
- Add your desired configuration changes after the AuthGroupFile /etc/group line. In this example, we will limit the maximum number of simultaneous FTP connections overall to 30, and the maximum from any single IP address to 1. Please work with your system administrator to customize these numbers for your system.
proftpd.conf
... AuthGroupFile /etc/group MaxClients 30 MaxClientsPerHost 1 "Sorry, you may connect only once from this IP." Include /etc/proftpd.include
- MaxClients - the total number of simultaneous FTP connections.
- MaxClientsPerHost - the total number of simultaneous FTP connections from a single IP address, followed by a custom error message. If a user tries to connect twice from the same IP, s/he will receive this error: 530 Sorry, you may connect only once from this IP.
- List the limit name: MaxClientsPerHost 1 "Sorry, you may connect only once from this IP."
- After a space, set the number of connections: MaxClientsPerHost 1 "Sorry, you may connect only once from this IP."
- Optionally, after another space, compose a custom error message, inside double quotation marks: MaxClientsPerHost 1 "Sorry, you may connect only once from this IP."
- MaxClientsPerUser - the total number of simultaneous FTP connections with a specific username.
- MaxLoginAttempts - the number of times a user can retry after a failed login attempt.
- Restart the FTP service on your server:
/etc/init.d/xinetd restart
Follow this format for any parameter:
You may also want to include some additional limits:
Finally, save your changes.
vi tip: Press "i" to enter "insert mode" so you can type and copy/paste. Press "Esc" to exit "insert mode" when you are done modifying the file. Type ":wq" to save and quit.
That's it. Users going over these connection limits should now receive an error message, and be unable to connect.
References
For a full list of possible ProFTPD directives, please visit the ProFTPD website.