Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am running Debian Wheezy, with ISPConfig 3, plus ModSecurity and I would like to restrict access to ftp to specific IP(s) globally (not to specific ftp users only), that can be either 127.0.0.1 or one I would manually add later. I would also like to completely disable ftp access from the web, but allow only from ftp-client software (if that is possible).

The idea of closing firewall ports is not what I want. I know I can do this setting some firewall rule though, but that is not what I currently need. I have managed to do this for example on phpmyadmin inside it's .conf file, but unfortunately I cannot find any configuration to alter for pure-ftpd in my system.

Restricting web-ftp access maybe possible by adding some rule in apache2 conf, but I am not sure how to write such a rule.

Thanks to everyone that can help cheers

share|improve this question

1 Answer 1

PureFTPD doesn't use .conf files by default, instead you specify options or switches at launch. You can however get it to parse a file, information on the PureFTPD site here;

http://download.pureftpd.org/pub/pure-ftpd/doc/README.Configuration-File

There's a sample conf file in the Github repo;

https://github.com/jedisct1/pure-ftpd/blob/master/configuration-file/pure-ftpd.conf.in

I think you want to use the

allow

command in the config, more info here;

http://doc.ctrlaltdel.ch/serveur/proftpd/reference.html#Allow

So you'd do something like;

<Limit LOGIN>
Order Allow,Deny
Allow from 192.168.1.1, 192.168.1.2 [etc]
Deny from all
</Limit>

That would deny all clients except those in the allow list.

share|improve this answer
    
thanks for your reply and information, the limit LOGIN though will deny login, what I want to do is return forbidden to ANY connection except the IP(s) specified, not only logins. Thanks. –  durduvakis Nov 4 '13 at 16:13
    
I would have thought a Firewall would be your only option after looking at the PureFTPd documentation - perhaps UFW? (help.ubuntu.com/community/UFW) –  sgtbeano Nov 4 '13 at 16:15
    
thanks for your help, ispconfig3 uses bastille and additionally I use mod_security and maybe in any of the 2 I can set some rule to do this if there is no other solution through a configuration file. I am currently checking the github conf file for such a thing. –  durduvakis Nov 4 '13 at 16:21
    
creating a /etc/pure-ftpd.conf is very interesting but unfortunately my system does not have pure-config.pl or pure-config.py in order to run those commands described in the README.Configuration-File you gave me. –  durduvakis Nov 4 '13 at 16:31
    
Just clone them from the Github repo and then use them –  sgtbeano Nov 4 '13 at 16:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.