Konfiguracja serwera FTP Linux
Step 1: Installing VSFTPD in Linux
You can quickly install VSFTPD on your Fedora/Red Hat/SUSE servers through the command line interface with:
dnf -y install vsftpd
If you are using Ubuntu/Debian-based distributions, you can install VSFTPD using this command:
sudo apt-get install vsftpd
If you are using Arch-based distributions, try this command for installing VSFTPD.
sudo pacman -S vsftpd
Step 2: Configuring FTP server
Most VSFTPD’s configuration takes place in /etc/vsftpd.conf. The file itself is well-documented, so this section only highlights some important changes you may want to make. For all available options and basic documentation see the man pages:
man vsftpd.conf
Files are served by default from /srv/ftp as per the Filesystem Hierarchy Standard.
Enable Uploading to the FTP server:
The “write_enable” flag must be set to YES in order to allow changes to the filesystem, such as uploading:
write_enable=YES
Allow Local Users to Login:
In order to allow users in /etc/passwd to login, the “local_enable” directive must look like this:
local_enable=YES
Anonymous Login
The following lines control whether anonymous users can login:
# Allow anonymous login
anonymous_enable=YES
# No password is required for an anonymous login (Optional)
no_anon_password=YES
# Maximum transfer rate for an anonymous client in Bytes/second (Optional)
anon_max_rate=30000
# Directory to be used for an anonymous login (Optional)
anon_root=/example/directory/
Chroot Jail
It is possible to set up a chroot environment, which prevents the user from leaving his home directory. To enable this, add/change the following lines in the configuration file:
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
The “chroot_list_file” variable specifies the file in which the jailed users are contained to.
Step 4: Restart your FTP server
In the end you must restart your ftp server. Type in your command line
sudo systemctl restart vsftpd
That’s it. Your FTP server on Linux is up and running. FTP is increasingly being replaced by FTP over SSH protocol so you may want to setup SFTP server on Linux.
Sebastián Darío Ramírez