FTP Service Setup: A Guide to File Transfer on Linux Servers

This article introduces the method of setting up an vsftpd FTP server on Linux systems. FTP is a standard protocol for network file transfer, and vsftpd has become a popular choice for Linux due to its security and stability. The steps include: 1. Preparation: A Linux server (e.g., CentOS/Ubuntu), administrator privileges, and network configuration are required. 2. Installation: For CentOS, use `sudo yum install vsftpd -y`, and for Ubuntu, use `sudo apt install vsftpd -y`. 3. Start the service and set it to start on boot: `systemctl start/ enable vsftpd`. 4. Firewall configuration: Open port 21 (control connection) and passive ports 50000-60000 (data transfer). 5. Create FTP users: Root login is prohibited. Use `useradd` to set the home directory, and `chown`/`chmod` to modify permissions. 6. Configure vsftpd.conf: Enable local user login and write permissions, restrict users to their own home directories, and specify the passive port range. 7. Testing: Connect locally using `ftp localhost`, or remotely with tools like FileZilla. Common issues such as connection timeouts and permission errors require checking the firewall, service status, and directory permissions. The above steps can complete the basic setup.

Read More