Difference: FTP is based on TCP to transfer files and does not provide any secure channel to transfer files between hosts; while SFTP is based on SSH to encrypt files for transmission and will provide a secure channel for transferring between hosts. document. 2. FTP passwords and data are sent in plain text format; SFTP are sent in binary form.
What is FTP?
FTP (File Transfer Protocol, File Transfer Protocol) It is one of the protocols in the TCP/IP protocol suite.
FTP protocol consists of two components, one is the FTP server, and the other is the FTP client. The FTP server is used to store files, and users can use the FTP client to access resources located on the FTP server through the FTP protocol.
When developing a website, the FTP protocol is usually used to transfer web pages or programs to the Web server. In addition, because FTP transmission efficiency is very high, this protocol is generally used when transmitting large files on the network.
What is SFTP?
SFTP is a secure file transfer protocol, a secure method of transferring files over a network; it ensures that data is transferred securely using a private and secure data stream.
SFTP requires that client users must be authenticated by the server and data transfer must occur over a secure channel (SSH), i.e. no clear text passwords or file data are transferred. It allows various operations to be performed on remote files, somewhat like the Remote File System protocol. SFTP allows recovery from operations such as suspended transfers, directory listing, and remote file deletion.
The difference between SFTP and FTP
SFTP and FTP are very similar, both support batch transfer (transfer multiple files at one time), file Folder/directory navigation, file movement, folder/directory creation, file deletion, etc. But there are still differences. Let's take a look at the differences between SFTP and FTP.
1. Secure Channel
FTP does not provide any secure channel to transfer files between hosts; while the SFTP protocol provides a secure channel for transferring files between hosts on the network .
2. Protocol used
FTP uses TCP/IP protocol. However, SFTP is part of the SSH protocol, which is a remote login information.
3. Link method
FTP uses the control connection on TCP port 21 to establish a connection. However, SFTP is a secure connection established between the client and server through the SSH protocol (TCP port 22) to transfer files.
4. Security
FTP passwords and data are sent in plain text format. In most cases, they are not encrypted and the security is not high. However, SFTP will encrypt the data before sending it. It is transmitted in binary form and cannot be read "as is", so it is highly secure.
FTP transfers files based on TCP and transmits user information and data in clear text.
SFTP is based on SSH to encrypt the transferred files, which has high reliability and can be resumed at breakpoints.
The above is the detailed content of What is the difference between sftp and ftp?. For more information, please follow other related articles on the PHP Chinese website!