Ftp protocol connection. FTP protocol. HTTP and HTTPS protocols

One of the oldest network protocols- this is FTP. What is it intended for, what is its role in the network “communication” of computers, how it works this protocol and whether it is worth using it - you will find the answers to all these questions in the article below.

What is the essence of FTP technology?

The modern FTP protocol is used somewhat differently than before. It was originally developed to work with large volumes of data. That’s why not only the FTP protocol was invented, but also the FTP archive. Now the latter has become a global repository for many files located on servers around the world. The archive is formed from a large number of FTP servers and there are special search engines, which allow you to search data by host, such as Napalm or FileSearch.

Not every part of the FTP archive can be accessed by an outsider through a search engine. There is a server with different levels access. Many people know FTP as the protocol that is needed to upload a website to hosting, that is, which is necessary for confidential use. FTP archives are used for exactly the same purposes for commercial organizations that store some kind of secret information in them.

But there are also many public FTP archives, which are similar to file sharing services. It is for such archives that special search engines have been created - so that users can find files right away, and not articles with long descriptions of programs or games, instead of the applications themselves.

What is the purpose of the FTP protocol

The FTP protocol is intended for data transfer between the client and the server. It’s called “data transfer protocol”. Since it has been used for a very long time, FTP has become one of the Internet standards. The protocol was first used back in 1971. During its existence it has changed a lot. Some functions were removed, and the emphasis was placed on the fact that FTP is well suited for exchanging data between remote computers. Over time it was made more convenient for ordinary users. After all, you can log into an FTP server either using a special program or using standard operating system services. For example, you can even connect to an FTP server using standard Windows Explorer.

In addition, FTP is designed to distribute access rights between server users. Different server users have their own set of rights. For example, some can only read data, while others can move, rename, edit and upload files to the host. Since creating an FTP server is as easy as using it, many users use this protocol to create remote access to your computers.

Some people confuse FTP and TCP. Although these concepts cannot be compared. FTP is a protocol and TCP is the channel over which it operates. And this channel is established between the server device and the client device. "Device" and not a computer, because FTP can also be used on smartphones using special programs, not only on PC.

Please note that FTP is a good protocol for working on a remote computer if you need to upload some data there, or vice versa - download it.

But for transmission confidential information This protocol is not suitable at all. That is why the developers of the Yandex Disk service refused to use FTP as the main protocol and chose WebDAV instead. FTP is an open protocol that does not encrypt data. And even if you set up password authentication for clients on the server, the data they enter during authorization will be transmitted to the host in clear text. That is, if they are intercepted, attackers will be able to penetrate the server.

How the FTP protocol works

In general, the operating model of the FTP protocol is very simple, so you should not have any problems while using it. The most common model is when the user uses an interpreter program. Using it, you can execute all commands in a convenient interface, so you don’t have to know them and enter them into the terminal. You issue commands to the interpreter, and it sends them to the server via a control connection. The control connection operates in the TELNET protocol. Thus, by establishing contact with the server interpreter, the user is authorized on the host and is able to use more commands.

The behavior of the server and client, as well as the data transfer process, depends on the set of commands transmitted over the control connection. In addition, using commands you can control file system client and server.

A different channel than the control channel is used to transmit data. But the latter initiates the data connection call. The operating principle of a data connection is different from the operating principle of a control channel, because the server initiates the exchange of files and data. Although this connection can be used in both directions: both for receiving and transmitting data.

But here is the general operating algorithm for any FTP protocol on the server:

  1. The server is always in some state of waiting on the user's side. The client can connect to the server at any time, because the control channel keeps port 21 open. This is where all control commands go. Port 21 is the default, but can be changed. Then the user will have to enter the port number manually, otherwise he will not be able to access the control channel.
  2. After connecting through the control channel port, the client-side program can issue commands to the server interpreter. These commands determine both changes within the server file system, as well as the method of data transfer, its content, volume, type of operating mode, and much more.
  3. After all commands for data transfer are agreed upon, one of the connection participants goes into passive standby mode (server or client). It waits until it is given a port number to open it and receive or send data on it.
  4. After the data transfer process is completed, the connection is closed, but the control channel still remains open. This allows the user to do everything again: give a command to the server and start transferring data again. There is no need to re-create the session. That's why FTP works using two types of connections.

Since this is the most common model of how the FTP protocol works, there are more complex cases. For example, when it is not the user who works with the server, but the server with the server. In this case, the client controls the transfer of data directly between servers, without intermediaries. And there are a lot of similar examples of server-client configurations. This is one of the advantages of the FTP protocol - flexibility of operation.

The main thing to understand is FTP work A protocol is the interaction of connections and ports. Most errors when working using this protocol are due to the fact that one of the parties to the connection has not configured its port. There is a passive and active side of the protocol. The passive one must listen carefully and wait until the active one transmits the port number, which must be opened immediately. If the port is not open, data transfer will not begin.

Don't think that you have to manually wait for some commands from the active participant in the connection - this is all done automatically. Problems appear when, for example, one or another port on your computer is already occupied or blocked for incoming/outgoing connections. It is at such moments that you will have to “roll up your sleeves” and manually configure the computer so that it can work correctly when FTP help.

What commands does the FTP protocol use?

Most likely, you will not need them in your work, since you will use the user agent in the form of a program with user-friendly interface. One such program is FileZIlla. But anything can happen. Perhaps you only have Far Maneger at hand, where everything needs to be done through the terminal. In that case, you should get to know main teams for FTP.

To connect to the server, you will have to use the USER command. It is necessary to indicate the name of the user who wants to open a session with the server. After you enter your user ID in the USER command, you need to enter a login password. To do this use special team- PASS.

One of the most popular features that allows you to “travel” around the server is CWD. The command is needed so that you can move between server directories. To use the command, enter CWD and the path of the directory you want to go to.

If in some case you need to reinitialize, that is, omit all data and settings of the current connection, then use the REIN command. While it is being used, data transmission does not stop and the transmission parameters remain the same as they were before the REIN command. Or you can do it in an even more radical way - close the control connection using the QUIT command. It also does not interrupt data transfer, and only after the download is completed is the session completely interrupted.

In order to register a port in active mode, that is, assign it to a passive participant, you need to use the PORT command. The problem is that this command is very difficult to write - you will need to specify 32 bits of the server IP and 16 bits of the port number, which is completely inconvenient. Therefore, it is better to find a way to use a simplified client to work via the FTP protocol, so as not to burden yourself too much. In such a client, changing the port number is a piece of cake. Just go to the settings, find the desired item and enter another number instead of the current one.

You will use the RETR and STOR commands to transfer data from and to the server. The first command is needed to send the selected file to the client device, and the second to the server. And to rename a file, you need to use two consecutive commands. First write RNFR with the old file name, and then RNTO with the new file name. You will also need the DELE command, which is needed to delete data from the file system, more precisely the file that is currently selected.

Other commands are used to remove directories. To remove the selected directory, you will need the RMD command. And to create new folder, use the MKD string. Also, users often need the function of viewing files that are in a directory. To do this, use the LIST or NLST command.

What are the analogues of FTP?

The FTP data transfer protocol has its direct “descendants”, that is, protocols that are derived from FTP. These are two protocols: TFTP and SFTP. The first protocol is not the most popular because it is very limited in terms of commands. It is much less suitable for managing the server's file system than FTP. You won't even be able to view a list of directory files using it. TFTP is needed only to transfer the simplest 8-bit information, no more. And in this protocol there are only 5 commands that are needed for reading, writing, requesting a data packet and other simple operations.

And here SFTP protocol much more successful than TFTP and in some cases - than FTP. The fact is that this is a secure FTP protocol. It is a combination of an encrypted SSH connection and the FTP data transfer protocol. In addition, SFTP eliminates many unnecessary functions that were introduced into FTP a long time ago, but are not used by anyone. That's why SFTP is safer than FTP, and at the same time more modest in in a good way this word. It is recommended to choose SFTP in cases where you are working with some kind of confidential data. Then, even if hackers intercept the data sent over the control connection, it will still be encrypted and will not bring any value to the hackers.

And it’s better to use the FTP protocol in normal client programs, and not in the terminal. After all, this way you will significantly speed up the work on the data transfer protocol and gain access to its more sophisticated functions.

The FTP (File Transfer Protocol) network file service is one of the earliest services used to access remote files. Before the advent of the WWW service, it was the most popular service for accessing remote data on the Internet and corporate IP networks. The first FTP specifications date back to 1971. FTP servers and clients are available in almost every UNIX operating system, as well as in many other network operating systems. FTP clients are built into Internet browsers today because FTP-based file archives are still popular and the browser uses the FTP protocol to access such archives.

The FTP protocol allows you to transfer an entire file from remote computer to local and vice versa, that is, it works according to the loading-unloading scheme. In addition, it supports several commands for browsing a remote directory and navigating directories on a remote file system. Therefore, FTP is especially convenient to use for accessing those files whose data does not make sense to view remotely, but it is much more efficient to move the entire data to the client computer (for example, files of application executable modules).

The FTP protocol has built-in primitive means of authenticating remote users based on transmitting a password in clear text over the network. In addition, anonymous access is supported, which does not require a username and password, which is more secure because it does not expose user passwords to the threat of interception.

The FTP protocol is implemented according to the client-server scheme. The FTP client consists of several functional modules:

User Interface is a user interface that accepts character commands from the user and displays the FTP session status on a character screen.

User-Pi is a user command interpreter. This module interacts with the corresponding FTP server module.

User-DTP is a module that transfers file data using commands received from the User-Pi module via the client-server protocol. This module interacts with the client's local file system.

The FTP server includes the following modules:

Server-Pi is a module that receives and interprets commands transmitted over the network by the User-PL module

Server-DTP is a module that controls the transfer of file data using commands from the Server-PL module. It interacts with the local file system of the server.

The FTP client and server support two parallel sessions - a control session and a data transfer session. A control session is opened when an initial FTP connection is established between the client and the server, and during one control session, several data transfer sessions can be performed sequentially, within which several files are transferred or received.

The general scheme of interaction between client and server is as follows:

1. The FTP server always opens TCP control port 21 for listening, waiting for a request to establish an FTP control session from a remote client.

2. After establishing a control connection, the client sends commands to the server that specify the connection parameters:

client name and password;

the role of the connection participants (active or passive);

data port;

transmission type;

type of transmitted data (binary data or ASCII code);

3. After agreeing on the parameters, the passive participant of the connection goes into the waiting mode for opening a connection to the data transfer port. The active participant initiates this connection and begins transferring data.

4. After the end of data transfer, the connection on the data ports is closed, but the control connection remains open. The user can activate a new data transfer session via a control connection.

Data transfer ports are selected by the FTP client (by default, the client can use the control session port for data transfer), and the server must use a port one smaller than the client port.

The FTP protocol uses several commands when the client interacts with the server (they should not be confused with the commands user interface client that the person uses).

These commands are divided into three groups:

system access control commands;

flow control commands;

FTP service commands.

The set of access control commands includes the following commands:

USER -- delivers the client name to the server. This command opens a control session and can also be issued while a control session is open to change the username.

PASS -- transmits the user's password in clear text.

CWD -- changes the current directory on the server.

REIN -- Reinitializes the control session.

QUIT -- ends the control session.

Flow control commands set data transfer parameters:

PORT -- specifies the address and port of the host that will be the active participant in the connection when transferring data. For example, the PORT 194,85,135,126,7,205 command makes host 194.85.135.126 and port 1997 the active participant (calculating the port number is not trivial, but it is quite unambiguous).

PASV -- Designates the host as a passive participant in the data connection. In response to this command, a PORT command must be sent indicating the address and port that is in standby mode.

TYPE -- specifies the type of data being transmitted (ASCII code or binary data).

STRU -- defines the structure of the transferred data (file, record, page).

MODE -- sets the transmission mode (stream, blocks, etc.).

As can be seen from the description, the FTP service can be used to work with both structured files, divided into records or pages, and unstructured ones.

FTP service commands initiate actions to transfer files or browse a remote directory:

RETR -- requests a file transfer from the server to the client host. The command parameters are the file name. An offset from the beginning of the file can also be specified - this allows you to start transferring the file from a certain place in the event of an unexpected connection break (this parameter is used in the reget command of the user interface).

STOR -- initiates file transfer from client to server. The parameters are the same as the RETR command.

RNFR and RNTO -- rename commands remote file. The first one receives the old file name as an argument, and the second one receives the new one.

DELE, MKD, RMD, LIST -- these commands respectively delete a file, create a directory, delete a directory, and pass a list of files in the current directory.

Each FTP protocol command is transmitted in text form, one command per line. The line ends with ASCII code characters CR and LF.

The user interface of the FTP client depends on its software implementation. Along with traditional clients operating in character mode, there are also graphical shells that do not require the user to know character commands.

Character clients typically support the following basic set of commands:

open hostname -- open a session with a remote server.

bye -- end the session with the remote host and end the ftp utility.

close -- ends the session with the remote host, the ftp utility continues to work.

ls (dir) -- prints the contents of the current remote directory.

get filename -- copies a remote file to the local host.

put filename -- copies a remote file to a remote server.

FTP stands for File Transfer Protocol. The main purpose of FTP is to forward (copy, transfer) files on the Internet (from a remote computer to a local one and vice versa). In addition, using FTP, you can work with your files directly on a remote computer (rename them, delete them, create directories, etc.).

To transfer a file using FTP, you need two programs: an FTP client and an FTP server.

FTP client Internet browser (MS) can serve Internet Explorer, Netscape Navigator), management program FAR files, specialized program CuteFTP and others. An FTP client is also built into some HTML editors, such as HomeSite, Dreamweaver or FrontPage.

FTP server - a computer that contains publicly accessible files and is configured to support the FTP protocol (the FTP server must have software, supporting FTP protocol).

  • A program that supports the FTP protocol on an FTP server monitors all requests coming from other computers (for example, from yours), processes them and provides a response.
  • When installing an FTP server, a directory accessible to other client programs is specified.
  • All files and directories have their own attributes that restrict access to them from remote computers. For example, you can make one file read-only, another read-write, a third execute-only, a fourth completely open to other machines, and so on. It's the same with directories. Some directories can be read-only, others can be read-write, etc.

FTP protocol operation algorithm

FTP operation at the user level contains several stages:

1. Identification (entering your username and password).

2.Select a catalog.

3. Determination of the exchange mode (block-by-line, stream-by-line, ASCII or binary).

4. Execute exchange commands (get, mget, dir, mdel, mput or put).

5. Completion of the procedure (quit or close).

FTP is a rather unusual procedure, as it supports two logical connections between computers (Fig. 1). One connection is for remote access and uses the Telnet protocol. The other connection is for data exchange. The server performs a passive open operation on port 21 and waits for a connection with the client. The client performs an active open operation on port 21. The channel remains active until the FTP procedure completes. TOS (Type of IP Service) corresponds to minimum latency since this channel is used for manual command entry. A data channel (TCP) is formed each time to transfer files. The channel opens before the transfer begins and closes with the code end_of_file (end of file). The IP Type of Service (TOS) in this case is focused on maximum throughput.

The end user interacts with a protocol interpreter, whose task is to manage the exchange of information between the user and the file system, both local and remote. The interaction diagram between different parts of the Internet during FTP operation is shown in Fig. 1.

First, at the client’s request, a control channel is formed, which is subsequently used to transmit commands from the client and responses from the server. The information channel is formed by the server at the client's command; it does not have to exist continuously throughout the entire FTP session and can be formed and destroyed as needed. The control channel can be closed only after the information exchange is completed. The control channel uses the Telnet protocol. Once the control channel is formed, the client can send commands over it. The server receives and interprets these commands and sends responses.

Rice. 1. Scheme of operation of the FTP protocol.

Organization of information exchange between two remote machines

Another interaction scheme is also possible, when, at the client’s initiative, a file exchange is carried out between two computers, neither of which is the client’s machine (Fig. 2).

Rice. 2. Organization of information exchange between two remote machines

During the exchange mode setting phase, the following options are provided:

1. The Block command preserves the structure of the logical records of a file. 2. The Stream command sets a mode in which control information for blocks is not sent. This is the fastest exchange mode and works by default. 3. The TYPE command can specify the exchange modes IMAGE, ASCII or EBCDIC. Of these, ASCII is used by default. The EBCDIC mode is used for exchanges between computers working with the EBCDIC character set. IMAGE mode involves the exchange of 8-bit bytes and is used to transmit binary (rather than text) information. More detailed list commands are placed below. Structurally, information can be transmitted in the form of files (default structure), as a sequence of records (applicable for text files ASCII or EBCDIC) or page by page (the latter structure is not recommended). 4. To copy a file from a remote server, use the GET command, to copy a group of files - MGET, to the latter case

wildcard characters are used, such as MGET *.txt (or RFC-18*.txt, which will copy files from RFC-1800.txt to RFC-1899.txt if they exist in the current directory). To some extent, an analogue of the GET command is the DIR (ls) command, only it transfers the contents of a directory, which is equivalent for some operating systems. When using the mget modification, be careful - you can block the telecommunication channel by lengthy copying. To write a file to a remote server, use the PUT command. During exchange operations, the current directory of the local computer is usually used. You always have the opportunity to change the local directory using

  • Formation of a channel under the control of the client, since it was the client who issued
  • get command
  • , dir, put, etc.

The client selects an arbitrary port number on his computer and carries out the passive open procedure for this port.

  • The client sends the port number to the server on the control channel (port 21) using the PORT command. It is possible to do without the PORT command (using the same port as the command channel), but this increases latency and is not recommended for this reason. - open connection. Opens a connection to the server. This name can be specified immediately when entering the command that loads the client: ftp ftp.karelia.ru.
  • cd directory_name - change directory. Moves to another working directory on the FTP server.
  • dir [filename] - display a list of files. Returns a list of files in the current directory. If you are interested in the directory listing format, click here. Don't forget that you can use group operation templates.
  • get filename [localfilename] - rewrite the file. Rewrites a file from a remote computer to a local one. If a name is specified local file, then writes it under this name, otherwise - in the default directory.
  • mget [filename] - overwrite a group of files. Same as get, but wildcards are allowed. Confirmation will be requested before each file is copied. To cancel confirmations, enter prompt.
  • prompt - cancels confirmation in mget and mput commands.
  • put filename [remote filename] - write the file to the server. Rewrites a file from the local computer to a remote computer under the name remote_file_name. If it is not specified, then the file is written to the current directory with the local file name. The command is prohibited for anonymous users
  • mput [filename] - write a group of files. Same as put, but wildcards are allowed. Confirmation will be requested before each file is written. To cancel confirmations, enter prompt.
  • ascii - sets the ascii method for transferring files. Used to send text files to English language. However, for reliability it is better to use binary.
  • binary - sets the binary method for transferring files. In this case, the file is not re-encoded during transmission and is recorded unchanged. This is the most reliable way file transfer.
  • close - closes the connection to this server and returns to command mode. This command is automatically executed when you exit the FTP client.
  • quit - exit from the FTP client.
  • user - registers on the current server with a new name. Use this command if you entered the anonymous username incorrectly the first time and do not want to retype the open command.
  • lcd [directory name] - makes the transition to local computer to the specified directory.
  • pwd - displays the current directory on the remote computer.
  • system - displays the type operating system on a remote computer.
  • help - help. Issues brief information about FTP client commands or about a specific specified command.

The FTP protocol is part of Internet standards and is used for transferring large amounts of information. The first specifications containing this protocol appeared in 1971. Since that time, the capabilities of FTP have expanded significantly and it is difficult to imagine how users could manage without it if they needed to download or upload several gigabytes to online storage necessary files. How much time would it take to transfer a website from a local machine to a server, or vice versa? Of course, you can use an archiver, but what if the server does not support this function? It's scary to even imagine. So FTP is quite a useful tool.

The term “protocol” means an agreed upon format for exchanging information between two devices. And how about “ file transfer protocol", which can be translated as "file transfer protocol". The FTP protocol uses a TCP channel. The exchange is built on the client-server principle. It is impossible to transmit using this protocol, since it does not have data protection and clear text is transmitted to the server. Of course, you usually need to authenticate to connect to an FTP server, but don't rely too much on this since the user ID and password are transmitted in clear text.

The FTP protocol is used to exchange information with FTP sites, which are huge repositories of useful and interesting information. The files on an FTP site are arranged in a tree directory structure, similar to that on your local computer. In order to view the contents of the storage, you can use any browser, but it is better, of course, to use a program specially created for this. Users who prefer to work with the OS command line can use the "ftp" command.

Some FTP sites have restrictions on access to their resources. Sometimes, in order to access them, you need to know the login and password of the registered user. Most FTP sites allow you to upload files without entering a password. But it is impossible to record your data on such resources.

How to use the protocolFTPif your OS is not Windows

If you prefer Linux, you can view the documentation for the available operations by typing $ man ftp. And in order to connect to the FTP server, you need to type $ ftp yoursite.at.domain. The most commonly used commands are:

  • binary - changing the mode to transfer binary (non-text) files, for example, pictures;
  • ascii - switching to transmission of text information;
  • cd foldername - change the current directory on the remote computer to a folder named foldername;
  • dir - view all files in the current directory of the remote computer;
  • help - help on using commands;
  • mget - simultaneous downloading of several files;
  • put filename - used to upload a local file filename to a remote resource;
  • mput - uploading several files to a remote resource;
  • exit - exit from FTP and exit to the OS.

You can also use programs such as gFTP, FOFF and FileZilla.

How to use the protocolFTPif you prefer Windows

In this case, everything is much simpler, and you Any will do FTP client that is easy to find on the web. Among the free ones, the most popular applications are FileZilla, FTPInfo, WinSCP. Connection using the FTP protocol can also be supported by such popular file managers as Total Commander And FAR manager. So, if you don’t use this protocol very often, then you can get by with them.

Well, if you just need to download something one-time, then you can type something like the following command in your browser instead of the URL:

ftp://user: [email protected]:port, in which

site.at.domain - server name,

port - port number to connect (usually 21, and can be skipped).

If you need to connect to anonymous FTP, then use the shortened command notation:

ftp://host.at.domain:port

It happens that some problems arise when connecting via FTP. In this case, it makes sense to check the FireWall and antivirus settings.

FTP is a protocol for transferring data from a user’s computer to a server, from a website to HDD or between servers. It appeared long before HTTP. Users can authenticate and perform the desired actions anonymously, whether this feature is provided. Today, there are specialized programs for transferring data via FTP and programs for web development with a built-in data exchange function.

Why do you need FTP?

With it, you can copy files from your computer to the server and from the server to your computer. One of the advantages of using FTP is that you can upload multiple documents at the same time. Some programs make it possible to edit files directly on the hosting. The standard client window is divided into two parts:

  • the first displays everything that is uploaded to the server;
  • in the second - everything that is on the computer.

In addition to these, auxiliary windows are used. The user selects the document that he wants to place on the hosting and transfers it. Before doing this, he must log in. The data is specified in the format: @resource name.domain name.

Some web hosts provide access to the site through programs like file managers. Some browsers already have a similar function built-in. There are also special components that can work with FTP.


Vulnerabilities

FTP is a very old protocol. It predates HTTP and was not designed to be secure. That's why he has a lot of problems with defense. Here are the most basic ones:

  • spoof attacks;
  • interception of user data;
  • sniffing;
  • port capture.

Files are not encrypted when transferred via FTP. Accordingly, all commands, usernames and passwords can be intercepted by attackers. For this, secure versions are used, for example for FTP - this is FTPS.

Secure data transfer

There are the following methods for sending data that are protected from: hacker attacks: FTPS, SFTP, and FTP transfer via SSH. With FTPS you can protect your session. The FTP server receives the AUTH TLS command and then rejects connections that are not encrypted.


SFTP has a similar list of commands as FTP. It uses the SSH protocol, which encrypts all traffic. Commands and data are encoded in this way. Accordingly, all passwords and other information not intended for third parties are not transmitted in clear text.

Another way to transfer over the SSH protocol is to tunnel the session over an SSH connection.

Connection and data exchange

There are two possible types works:

  • active;
  • passive.

They differ in the way the connection is established. The active method assumes that the program creates a TCP connection to the server and sends the required IP and port. Passive is needed when such connections are blocked by a firewall. Then the server returns the address and port, then the user uses the received data to connect.

IN FTP settings You can select the following transmission modes:

  • in-line;
  • block;
  • compressed.

When you select the first mode, data is sent as a continuous stream. Processing is performed over TCP. In normal mode, data is segmented and, as a rule, sent in the following form: header block, number of bytes, data field. In the compressed method, all data is compressed using one algorithm and is transmitted much faster due to the fact that the object weighs less.

Authorization

To identify the user and subsequently assign rights to manage files, the username/password scheme is used. The name is sent with the USER command, and the password is sent with PASS.


The server accepts this data if it matches those specified in the database. Next, the client receives an invitation, after which the session begins. Sometimes the server supports the ability to log in without credentials. Typically provided limited access for such connections, some standard name is used, for example anonymous. But most often, for authorization you need to enter a valid email address, and in the future it is used to log in.

Difference from the http protocol

One of the striking features of FTP is multiple connections, in which the server receives commands and sends a response over one channel, and transmits data through others. Thanks to this, you can upload or download many files at the same time.


Reducing traffic costs and, accordingly, reducing the time for data exchange is carried out due to the binary transmission mode. The work begins after the client enters the session, and all further operations are carried out within its framework. This is one of distinctive features, because the HTTP protocol does not remember information about registered users - this function is performed by external methods.

Computer-client communication is carried out on port 21 by default and is used for management. A second data connection is opened on port twentieth or any other that is correctly configured.

How to work with files

Exists FTP clients for working with the protocol, but working with them is based on the same principle. All that is needed for transfer is to drag the document from the user’s computer to the server folder or do the same actions using command line.

  1. After the main window appears, you need to enter the host name, user name, password, and port in the appropriate fields.
  2. After successful authorization, a list of everything uploaded to the server appears.
  3. You should select the object that you want to upload to the server from a computer or from a server to a computer.
  4. Having marked the appropriate file, call context menu using RMB, select the desired action: download, add to task, edit, delete, rename, copy address, configure access rights. These features may vary depending on the program you are using.

There is a way to exchange between two servers directly without downloading to your computer. Two connections to different servers are requested. On one of them, a file is selected for transfer and the IP address of the second server is indicated. For this, FXP is used - direct exchange protocol.

The main advantage of using this method is high speed downloads. It does not depend on bandwidth Internet connection of the user who wants to transfer the file. The time it takes depends on the connection speed between the remote FTP servers. As a rule, it is obviously larger than the custom one.

It should be noted that this protocol has begun to be used by attackers to launch attacks on other servers. To prevent such actions, the IP address is now checked and if a discrepancy is found, it is blocked.

FTP connection via browser

To connect, as when using specialized programs, the user must have a login, password, and IP address. The connection itself occurs using the command line. To do this, you need to enter an address in the following format: ftp://login: server password@ip address. For example, ftp://myname: [email protected]. If the connection is successful, a list of all documents appears. Typically, site files are stored in the public_html or www folder, depending on the type of hosting.

To copy a document, simply drag and drop it. This method does not allow you to transfer documents from one server to another. It's easy to change read/write permissions in the browser. For this you need right click mouse to select a file that is already on the server. A settings window will appear. It should indicate the required permission.

FileZilla

This is one of the most popular FTP clients for Windows. Working with this program is quite easy. The main window is divided into five parts. Three of them display the file structure of the computer, and four show the server. The required fields indicate login, password, and port.


If you plan to use a particular connection frequently, login information is specified in the "Site Manager". In the settings, you can select identification, distribute login information into folders, and add a comment. To transfer the file, you need to select and drag it into the working window, where the file structure computer.

Total Commander

In order to upload and download a file using "Total Commander", you must perform the following sequence of actions:

  1. Go to the "Network" tab.
  2. Select the menu item "Connect to server".
  3. In the window that appears, click the "Add" button.
  4. Specify the connection name, server, account, password.
  5. Set the "Passive exchange mode" flag and click OK.
  6. After this, mark the selected connection and click the “Connect” button.

Command line

If the user does not want to use graphical interface, although this is quite convenient and allows you to perform some functions faster, it can use the command line:

  1. The connection is made using the Open command. The usage should look like this: open ftp.server.com port.
  2. The port parameter can be omitted if standard 21 is intended to be used.
  3. Instead of server.com, the address of the server on which the site is located is indicated.

To rename, use rename, to change the current directory, cd is used as standard, to exit you need to enter close, and to delete - delete or disconnect.