Informed and experienced hosting users, of course, know about FTP. But beginners will find it useful to know what FTP is and why it is needed
What is FTP
In brief, File Transfer Protocol is a reliable and simple tool that helps you to share documents at a distance. You can download music, movies, documents, programs, pictures, drivers, etc. In hosting, FTP is usually used for access to change configuration files or site folders
Unlike other application layer protocols (DNS, HTTP, HTTPS, SMTP, SSH, etc.) it is easy to use. If any error occurs during file transfer, the process is interrupted and the user can see an error message. And if the data exchange goes smoothly, you have received or downloaded the file you wanted.
This tool is used by ordinary users, programmers, and enterprises for local storage or exchange of data. FTP also makes it possible to upload and download files to the server (to users with the necessary rights or even anonymously, if the file owner has such a task).
What is required to exchange data? An FTP client (a program to connect to an FTP server) and an FTP server.
Server task:
- to manage characteristics (connection parameters), to determine the address and port of the server where the files are exchanged
- to provide access to the saved files via login and password
- to provide only those folders and files to which a particular user is authorized to have access
Different programs use different FTP clients, such as
FileZilla, CrossFTP, CuteFTP, TotalCommander
,
etc. And Linux supporters in general prefer to work with the command line))
How it works
FTP (File Transfer Protocol) uses two main ports for its operation: port 21 and port 20, but their use depends on the FTP mode of operation:
1. Port 21 (Command Port)
- Used to establish a connection between the client and the server.
- Commands and responses (connection control) are transmitted on this port.
- Remains open throughout the session.
2. Port 20 (Data Port)
- Used to transfer data (files, directory listings).
- Engaged in FTP Active Mode.
FTP operation modes:
FTP can work in two modes: active and passive, which affects the ports used.
Active Mode:
- The client initiates a connection to the server on port 21 (control).
- The server initiates the data transfer by opening a server-side connection (port 20) to a dynamic port on the client.
- Using port 20 can cause problems with firewalls and NATs.
Passive Mode:
- The client initiates both connections:
- On port 21 (control).
- On a random port, the server tells the client to transmit data (ports outside the standard range, such as 1024-65535).
- Passive mode solves firewall problems because the server does not initiate connections.
Summary:
- Port 21 - used for FTP session management.
- Port 20 - used in active mode for data transfer.
- Dynamic ports (usually 1024-65535) - used in passive mode.
The server administrator must configure the network hardware (firewalls, NAT) depending on the selected FTP mode
Advantages of working via File Transfer Protocol
1. Ease of use
The FTP protocol is easy to set up and use. Most FTP clients (e.g. FileZilla, WinSCP) have a user-friendly interface for uploading and downloading files.
2. Scalability
FTP supports the transfer of large amounts of data, including large file sizes or large volumes of directories.
3. Transmission recovery support
In the case of a connection failure, FTP allows you to resume file transfer from the point where it was interrupted.
4. Automation
FTP is easy to automate with scripts or special software to back up or synchronize data regularly.
5. Accessibility
FTP is compatible with most operating systems and client programs and is also supported by standard hosting services.
6. Support for different types of access
Possibility to authenticate via login/password or use anonymous access (without login).
7. Transmission speed
FTP provides fast file transfer speeds, especially on local networks or when properly configured.
8. Ability to manage access rights
Administrators can customize file and directory permissions for different users.
FTP protocol disadvantages
1. Low level of security
- Open data transmission: Classic FTP transmits data (including login and password) unencrypted, making it vulnerable to interception (man-in-the-middle attacks).
- No encryption: Classic FTP does not encrypt transferred files, which creates a risk of data leakage.
2. Difficulty in configuring the firewall
FTP requires both command and passive/active data links, which can create difficulties with firewall or NAT configuration. This makes it difficult to use FTP on corporate networks.
3. Lack of modern features
FTP does not support intelligent file synchronization, metadata or version control, which are standard in modern cloud services (e.g. Google Drive, Dropbox).
4. Limited access control
Although FTP allows you to customize access rights, the process is less flexible than modern access control systems.
5. Out-of-date protocol
FTP was developed many decades ago, so it does not meet today's standards for efficiency and security. New protocols such as SFTP (secure FTP over SSH) or FTPS (FTP with SSL/TLS support) offer improved functionality.
6. Problems with transmission speed in some networksх
In networks with high latency or high latency, FTP may not work efficiently due to its architecture.
7. Non-intuitive interface for regular users
While FTP is handy for technical people, it can be difficult for regular users to understand FTP clients and terminology.
8. Audit and logging problems
FTP offers limited ability to monitor and audit user actions. In enterprise environments, this can be a disadvantage.
9. Dependence on network connection
FTP does not work properly on unstable networks because it is ill-equipped to handle frequent connection drops.
Despite the protocol's obsolescence and shortcomings, this method of file transfer is still a popular and convenient way to quickly work with static data, transfer web files to servers, and automate downloads or backups..
It is recommended to use secure versions - such as FTPS or SFTP- to ensure secure transmission.