36.1 Overview of File Transfer Protocol (FTP)
The File Transfer Protocol (FTP) provides users with file upload and download services.
Overview
FTP (File Transfer Protocol) is one of the earliest application-layer protocols in the TCP/IP protocol suite, used for network file transfer.
Setting up an FTP server on FreeBSD enables fast file transfer and sharing in both LAN and internet environments.
This section introduces three commonly used FTP server software packages:
Pure-FTPd
ISC license (functionally equivalent to the 2-clause BSD license), security-first, supports multiple operating systems, relatively complete implementation of the FTP protocol specification
Provides high flexibility for ISPs and hosting services, suitable for beginners
ProFTPD
GPLv2 license, supports multiple operating systems, single main configuration file, strong extensibility
Suitable for users familiar with Apache HTTP Server (similar syntax)
vsftpd
GPLv2 (with exception clauses) license, supports IPv6 and SSL encryption, supports virtual users, virtual IPs, fine-grained user and IP control, bandwidth limiting
Oriented towards production environments
Security of the FTP Protocol
The standard FTP protocol transmission process is insecure: both passwords and data are sent in plaintext, and no encryption is applied by default.
Perhaps completely phasing out the FTP protocol is the only solution.
Note
Running an anonymous FTP server may pose potential risks. In particular, careful consideration should be given to whether anonymous users are allowed to upload files. FTP sites may become venues for unauthorized commercial software transactions, or even lead to more serious consequences. If anonymous FTP uploads are required, ensure that permissions are set correctly so that other anonymous users cannot read files before the administrator reviews them.
FTP Client Usage Examples
Using telnet to test the FTP service:
The above command is used to test whether port 21 of the FTP service on the local host is available.
Using the ftp command provides a convenient way to connect to an FTP server. Its basic usage is as follows:
FTP commands:
In addition, the following FTP protocol commands can be sent to the server via quote:
Operation example:
FTP downloads files to the current working directory by default (i.e., the directory where the ftp command was started).
Last updated