Uploading is a simple operation whether it is a web disk or a cloud storage device. What is the meaning of the FTP protocol used by those convenient and easy to upload and arrange tools, and what is the difference between the multiferous mode?
Erguzi recently built a picture sharing website, there are a lot of people upload many photos on his website every day, these photos will be synchronized to the cloud storage through the internal logic, very convenient.
But soon the problem came, because the beginning of the user photo management planning did not do well, with the user upload more and more pictures, the cloud storage content is more and more chaotic, two dogs look very uncomfortable. This is not, taking advantage of today’s rest, two dogs decided to adjust a good.
Two dogs opened and shot cloud console, up and down to find the corresponding file to move to the corresponding directory in the function. After asking for help from customer service, Customer service Weiwei told him that he could manage cloud storage files through FTP tools, and also provided a detailed help document to Erguzi – FTP tool to connect and cloud storage documents [help.upyun.com/knowledge-b…] .
Two dogs finally through FTP tool connected to the cloud storage, after a meal operation, two dogs successfully put the photos neatly. Looking at this let obsessive-compulsive disorder patients satisfied comfortable storage interface, and looked at the FTP tool to create this effect, two dogs satisfied nodded, decided to do a thorough understanding of FTP, also see FTP there are no other good functions.
Introduction to FTP, FTPS, and SFTP
FTP
Before looking at the related functions, two dogs found that the client has three different protocols, respectively FTP, FTPS and SFTP, in order to find out what this is, two dogs opened the universal encyclopedia.
FTP (File Transfer Protocol) is an application-layer Protocol used to Transfer files between clients and servers on computer networks. A complete FTP is composed of an FTP server and an FTP client. The client can upload local files to the server over FTP or download the files on the server to the local PC. It is one of the oldest file transfer protocols in use today and is a very convenient way to move files around.
How FTP works
FTP connection requires communication between the FTP server and the client on the network. There are two different communication channels for establishing an FTP connection. One, called a command channel, is used to issue and respond to instructions. The other is the data channel for data interaction between the client and server.
When transferring files through FTP, users need to provide credentials to the FTP server to obtain file transfer permission. Of course, some public FTP servers may access files without credentials, but the security of data transmission cannot be guaranteed. Data transmission on any unencrypted public network is very dangerous. Therefore, the following two protocols are derived from FTP: FTPS and SFTP to protect the security of transmitted data.
FTPS
FPTS has two modes: implicit SSL and FTPS display SSL, both of which are encrypted with SSL. So what’s the difference?
-
FTPS implicit SSL: This mode usually runs on port 990. All data exchange in this mode requires the establishment of an SSL session between the client and the server, and the server rejects any connection attempts that do not use SSL.
-
FTPS explicit SSL: indicates that the SSL server can support BOTH FTP and FTPS sessions. Before starting the session, the client needs to establish an unencrypted connection with the FTP server and send AUTH TLS or AUTH SSL command to request the server to switch the command channel to SSL encryption channel before sending the user credentials. After the channel is successfully established, the user credentials can be sent to the FTP server. This ensures that any command during the session can be automatically encrypted over the SSL channel.
Two dogs to give you a simple and quick summary. When implicit mode is enabled, the default FTP port is changed to TCP/990, the server automatically establishes a secure connection, and the client must also support secure connection mode, that is, SSL connection. When the explicit mode is enabled, the FTP connection mode and the default port are the same, but the secure connection can be normally transmitted only after the AUTH SSL/TLS command is used to activate the secure connection.
SFTP
Finally, let’s take a look at SFTP, which stands for Secure File Transfer Protocol, or Secure File Transfer Protocol.
If FTPS is an SSL layer on TOP of FTP, SFTP is a network protocol based on SSH (security shell), which is completely different from FTP. SFTP does not use a single command channel or data channel. Instead, data and commands are transmitted over a single connection in a special format.
SFTP provides two ways to verify connections.
-
As with FTP, you only need to verify the user ID and password to connect. However, unlike FTP, these credentials are encrypted, which is the main security advantage of SFTP.
-
In addition to passwords, SSH keys can also be used for authentication and connection through SFTP.
After understanding these protocols, ergou zi is more comfortable using FTP client tools, he can change the protocol and encryption mode according to their own needs, and do not need to understand a setting and trouble.
However, the new question has emerged, two dogs see here in the transmission setting of the transmission mode, there are active and passive points, what does this mean? He opened Google again…
FTP software active mode and passive mode difference
Active mode
The default FTP mode is active mode, also known as port mode.
It works in two steps:
-
First, a command channel is established between a random PORT on the client and FTP PORT 21 on the server. The client sends the PORT command to connect the server to one of the ports on the client and establish a data channel.
-
The server then connects from port 20 to the client port specified for the data channel. Once the connection is established, files can be transferred through these client and server ports.
Passive mode
In the transfer mode bar, you can also manually adjust to passive transfer mode. In this mode, the client will connect to port 21 on the server through random port A and issue the PASV command to establish the command channel, telling the server that the connection is in passive mode. After that, the server opens a random port for data transmission, and the client establishes a data channel through random port B, which is different from the port that issues the command, for file transfer.
Passive mode differs from active mode in that the client initiates the data connection. In active mode, after the client establishes a connection on the command channel, the server initiates a data connection with the client. In passive mode, after the command channel is established, the client starts the data connection with the server.
Because of this difference, we can draw the advantages and disadvantages of both. For example, the active mode facilitates the management of the FTP server because you only need to enable Port 21 access and port 20 Access. However, the port between the server and the client is random. Therefore, the client may trigger the firewall or even be blocked by the firewall. Passive mode, on the other hand, is good for managing clients.
I didn’t expect that a seemingly simple storage tool has so many classifications and differences, different modes and different ways can correspond to different needs, it seems that in the future when using the tool, we can still know a little bit of relevant knowledge, can make the tool more comfortable to use
Recommended reading
HTTP/3 is coming. Do you know it?
Which is better, TCP or UDP