Archive for the tag 'FTP'

How to disable anonymous FTP in EnsimPro for Linux

By deafult the configuration file is: /etc/proftpd.conf has the last line as:

include “/etc/proftpd/anonymousftp”

which means anonymous ftp is enabled.

Upon commenting this out with a ” # ” and restarting the service ,anonymous ftp is disabled.

Enable passive mode for FTP in Plesk Panel

Log in as “root” to the server shell over SSH.

Edit your ProFTPD configuration file.

1. Issue the command vi /etc/proftpd.conf
2. Add the following lines anywhere within the [Global] section:

PassivePorts 49152 65534

3. Save the file

Log in to Parallels Plesk Panel as “admin”, go to Modules > Firewall, and click Edit Firewall Configuration.

Click Add Custom Rule.

Specify the following:

1. Rule name
2. Direction: select Incoming.
3. Action: select Allow.
4. Ports: in the Add port input box, enter the value 49152-65534. Leave the TCP option selected, and click Add.
5. Click OK.
6. Click Activate, and then click Activate again.

Hiding folders to avoid deletion via FTP

It is better to hide tmp/usr/lib/var folders via the conf file(when accessing ftp) so that these folders will not be accessed by the users.

If it is proftpd, find out the proftpd.conf

Add the following to the proftpd.conf file:

<Directory ~>
HideGroup wheel
</Directory>

<Directory ~>
HideNoAccess yes
</Directory>

Enter the directory path near to “<Directory >”, like “<Directory /var/www/vhosts/domainName/httpdocs/folder>”

After modification, restart the FTP.

Configuring FTP server for passive mode.

The common issue faced while running FTP in passive mode is the firewall.

Usually, in FTP servers like pure-ftp, the Passive Port Range can be specified in its configuration file itself.

But, if the Passive Port Range isn’t specified, the server uses the locally available ports for FTP.

These port ranges are specified in /proc/sys/net/ipv4/ip_local_port_range file.

Please follow the below method so that the ports remain constant and FTP runs smoothly.

1. Configure sysctl and set the port range in /etc/sysctl.conf as, net.ipv4.ip_local_port_range

2. sysctl -p would load the new kernel values.

3 Open the port range specified above in your firewall.

« Prev