In actual project development, the most commonly used file transfer methods are FTP and SFTP, but what are the characteristics of these two transmission methods? This article will discuss the differences between SFTP and FTP. 1. FTP protocol FTP is one of the protocols in the TCP/IP protocol suite. The TP protocol consists of two parts:
By default, the FTP protocol uses TCP ports 20 and 21. Port 21 is used to transmit control information, and whether to use port 20 as the data transmission port depends on the transmission mode used by FTP. If the passive mode is used, the specific port to be used is determined by negotiation between the server and the client. There are two FTP transmission modes:
1. Active mode The FTP client first establishes a connection with the TCP port 21 of the FTP server and sends commands through this channel. When the client needs to receive data, it sends the PORT command on this channel. The PORT command contains the port that the client uses to receive data. When transmitting data, the server connects to the client's specified port through its own TCP port 20 to send data. 2. Passive mode The establishment of control channel is similar to active mode, but after the connection is established, the Pasv command is used. After receiving the Pasv command, the FTP server randomly opens a high-end port (port number greater than 1024) and notifies the client of the request to transmit data on this port. The client connects to this port of the FTP server, establishes a channel through three-way handshake, and then the FTP server transmits data through this port. Note: Many firewalls are not allowed to accept connections initiated from the outside when they are set up, so many FTP servers located behind firewalls or in intranets do not support PASV mode, because the client cannot pass through the firewall to open the high-end port of the FTP server; and many intranet clients cannot log in to the FTP server in PORT mode, because TCP 20 from the server cannot establish a new connection with the client in the internal network, causing it to fail to work. 2. SFTP protocol
SFTP is the abbreviation of SSH File Transfer Protocol, a secure file transfer protocol. SFTP and FTP have almost the same syntax and functions. SFTP is a part of SSH and is a secure way to transfer files to the Blogger server. In fact, the SSH software package already includes a secure file information transfer subsystem called SFTP. SFTP itself does not have a separate daemon process. It must use the sshd daemon process (the default port number is 22) to complete the corresponding connection and response operations. So in a sense, SFTP is not like a server program, but more like a client program. 3. The main differences between the two
|
<<: In-depth analysis of the seven major communication protocols of IOT
>>: Kunpeng gathers data, shines in the Central Plains, and promotes the digital economy
While drawing parallels between 5G and national s...
The long-feared exhaustion of global IPv4 address...
How will China Mobile and China Telecom respond t...
A data center is a complex organization with many...
On October 12, 2021, during the 2021 China IPv6 I...
Content framework: Big Data Overview Flink Learni...
5G is a leading technology in the new generation ...
Communication and network protocols are an essent...
Continue from the previous article "Introduc...
[[312427]] Preface When you open a browser, enter...
[[271597]] TSN is the abbreviation of time-sensit...
Aruba, a Hewlett Packard Enterprise company, rece...
Docker provides a variety of network drivers, all...
According to foreign media reports, Russian telec...
[[402875]] Railways are the backbone of sustainab...