How to configure FTP in BitrixVM

It is recommended to use the protocol SFTP to transfer files in the BitrixVM control panel. By default, the FTP protocol is not used in BitrixVM.

If you need to work via FTP, you should first configure FTP on the virtual server.  

1. Connect to the server via ssh.

2. Press 0 to exit the Bitrix menu to the main menu.

3. To install ProFTPD run:

yum install proftpd

4. To add ProFTPD to autorun run:

chkconfig proftpd on

5. To start the service, run the command:

service proftpd start

6. In order to find out the group id and user id (for the main VPS user) run:

id bitrix

7. As a result of executing the command, you will receive something like this:

how-to-configure-ftp-in-bitrixvm

8. Add a new user who will connect via FTP using this id. After the –d switch, specify the home directory of this user.

adduser new-user-name -g600 -o -u600 -d /home/bitrix/www/

9. Set a password for the new user with the following command:

passwd new-user-password

Firewall configuration

By default, CentOS 7 uses firewalld. Earlier versions of the CentOS use iptables. Also, some users replace firewalld with iptables.

firewalld

1. Add a rule:

firewall-cmd --add-service=ftp --permanent

2. Restart firewalld:

firewall-cmd --reload

3. To check the changes, connect to the server via FTP using the created user.

iptables

1. Open the file:

Nano /etc/sysconfig/iptables

2. Under the OUTPUT ACCEPT line, add the following lines:

-A INPUT -p tcp -m tcp --sport 21 -j ACCEPT

-A INPUT -p tcp -m tcp --sport 20 -j ACCEPT

-A INPUT -p tcp -m multiport --dports 20,21,50000:50400 -j ACCEPT

3. Press Ctrl + x to exit. Press Y and Enter to save your changes.

4. Open the file iptables-config:

nano /etc/sysconfig/iptables-config

5. For parameter IPTABLES_MODULES set the following value:

IPTABLES_MODULES="ip_conntrack_ftp"

Save your changes.

6. Restart iptables:

service iptables restart

7. To check the changes, connect to the server via FTP under the created user.

If you have any questions, please create a ticket to technical support.