To be able to work with the server by FTP, you need to install and configure special software on the server - an FTP server. One of the most popular and convenient FTP-servers is ProFTPd.
For installation FTP-server you need to connect to the server by SSH or VNC, install the program and edit the configuration files. Different distributions perform these operations differently:
yum install epel-release
yum install proftpd
firewall-cmd --permanent --add-port=20-21/tcp firewall-cmd --permanent --add-port=40900-40999/tcp firewall-cmd --reload
systemctl enable proftpd
systemctl start proftpd
useradd example -d /var/www -s /sbin/nologin passwd example
Enter the required data:
example
provide username FTP-user./var/www
specify home directory FTP-user.passwd example
you will need to enter your password twice FTP-user.apt-get install proftpd
echo "/bin/false" >> /etc/shells
adduser --home /home/example --shell /bin/false example
Instead of a directory /home/example
as the home directory, you can specify the directory /var/www
.
chown example -R /var/www
example
- specify the created user earlier./var/www
- specify the directory for which the access rights are changed. Note It is worth specifying the directory where the site files are located to be able to edit them (by default, this /var/www
).emerge --ask net-ftp/proftpd
cp /etc/proftpd/proftpd.conf.distrib /etc/proftpd/proftpd.conf
rc-update add proftpd default rc-service proftpd start
systemctl enable proftpd
systemctl start proftpd
adduser --home /home/example --shell /bin/false example
Instead of a directory /home/example
as the home directory, you can specify the directory /var/www
.
chown example -R /var/www
example
- specify the user created earlier./var/www
- specify the directory for which the access rights are changed. Note It is worth specifying the directory where the site files are located to be able to edit them (by default, this /var/www
).dnf -y install proftpd
/etc/proftpd.conf
). At the end of the file add the line:PassivePorts 21000 21020
systemctl enable proftpd
systemctl start proftpd
setsebool -P ftp_home_dir=1 setsebool -P allow_ftpd_full_access=1 # Firewall settings firewall-cmd --permanent --add-port=21/tcp firewall-cmd --add-port=21000-21020/tcp --permanent firewall-cmd --reload
useradd example -d /var/www -s /sbin/nologin passwd example
Enter the required data:
example
provide a username./var/www
specify the home directory.passwd example
you will need to enter the password for the user twice.nano /etc/proftpd/proftpd.conf
Change the lines:
ServerName
- specify the server name.ServerType
- specify the launch mode:standalone
- automatic start at system startup (default mode).inetd
- exclusively manual start.# DefaultRoot
- remove the symbol #
at the beginning of the line. This parameter specifies access to the default directory. To determine the default access to the user's directory, you need to specify the value ~
.UseReverseDNS off
before the line # Use this to jail all users in their homes
(default line 34).proftpd -t
/etc/init.d/proftpd restart