This page has been robot translated, sorry for typos if any. Original content here.

We also set up an FTP server. Part 1

To measure the increased availability of the Internet and local networks, many users begin to want or need to share files with other people. In principle, it is allowed to do this also with the help of “shared access”, using the built-in capabilities of the operating system. But via the Internet it is also dangerous to install VPN, only on the local network - it does not allow limiting the download speed either, and your computer can be approximately paralyzed with an active download of impressive files. In order to avoid all these problems, you should set up an FTP server, which will allow you to flexibly manage traffic volumes, centrally manipulate the lists of available files for users as well, just like using a program to download files with a resume later than a break (for example, ReGet).

In order to further understand some of the settings, consider what the blah blah is the FTP labor algorithm.
FTP (File Transport Protocol), created specifically for file transfer, works on a pair of ports. The client connects to the server (by default, port 21) also transmits commands to it, only for transferring files the server connects to the customer, files are also transmitted via this channel. This mode (the server connects to the client) is called "PORT", it also cannot be used by users going to the Internet through NAT, so the mode was invented where the customer sets the second connection for file transfer - this is called "PASV" or "passive FTP -protocol".

Microsoft Internet Explorer only since version 5.5 has learned to work in PASV-mode (it is allowed to enable the corresponding option in its parameters). But the "PORT" mode did not give up in any way - in advanced FTP clients (such as CuteFTP, FTP-Voyager and even Total Commander) it is allowed to specify the port range for the PORT mode, which these clients will forward to NAT on your machine request the server connects to these ports.

To eat a couple of data transfer options - Binary is also ASCII. In the "Binary" mode, any data is transmitted, but a little slower; In ASCII mode, only text files can be transferred. The transfer mode is selected by the customer, usually also the ASCII mode is automatically automatically set for TXT, HTML, INI files and other explicitly text ones. It is better to always use the "Binary" mode for all files.

FTP can own various extensions in the schedule of protection from interception of traffic. Protection against interception may exist implemented by duplicate methods, depending on the required level of security.

First, it is allowed to use encrypted passwords (OTP-MD5), as a result of which a password will not be transmitted via the communication channel, only its hash, and with adding pores - therefore, attackers will not be able to find out the password, only by adding pores to resend copies of the hash from the attackers will not be accepted. This will not allow attackers to log into a personal FTP account.

Secondly, it is possible to encrypt all FTP traffic (FTP SSL / TLS). This will not allow attackers to get all the files that you transferred. But I’ll note that the standard clients that are initially present in Windows (Internet Explorer is also ftp.exe) do not have any of these methods of protection from interception, therefore users of your FTP server will have to use alternative FTP clients - CuteFTP or FTP-Voyager.

Well, we received some initial information about the features of the FTP protocol, but now it’s time to start creating your own FTP server as well. How to do this operation on the sample program Serv-U , we will talk to other elements of our material.