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
Assuming your company has no funds for upgrading ...
IMIDC has launched a 6.18 promotion, offering spe...
It’s the end of another year. Looking back at the...
As the demand for mobile networks continues to ex...
Time flies, and the promotion of 5G has been goin...
In December last year, we shared the news that Ho...
Lossless video transmission is critical to variou...
edgeNAT has launched a promotion for this month. ...
"Revoke 230!" US President Trump wrote ...
[[409660]] Environment: springcloud Hoxton.SR11 T...
SpartanHost, also known as Sparta, is a foreign h...
Stefan Pongratz, vice president and analyst at ma...
In August, the three telecom operators successive...
At a time when all walks of life are experiencing...
[51CTO.com original article] On March 22, "G...