All about ftp [ File Transfer Protocol ] Must Read !!

Well, since many of us have always wondered this, here it is. Long and drawn out. Also, before attempting this, realize one thing; You will have to give up your time, effort, bandwidth, and security to have a quality FTP server. That being said, here it goes. First of all, find out if your IP (Internet Protocol) is static (not changing) or dynamic (changes every time you log on). To do this, first, consider the fact if you have a dial-up modem. If you do, chances are about 999 999 out of 1 000 000 that your IP is dynamic. To make it static, just go to a place like h*tp:// to register for a static ip address. You'll then need to get your IP. This can be done by doing this: Going to Start -> Run -> winipcfg or and asking 'What is my IP?'

All about ftp [ File Transfer Protocol ] Must Read !!

In the wake of doing as such, you'll have to download an FTP server client. Actually, I'd suggest G6 FTP Server, Serv-U 

FTP or Bulletproof v2.15 each of the three of which are very solid, and the standard of the FTP world. 

You can download them on this webpage: h*tp:// 

To begin with, you'll need to set up your FTP. For this guide, I will utilize bit by bit directions for G6. To begin with, 

you'll need to go into 'Arrangement - > General'. From here, type in your port # (default is 21). I suggest something novel, or something somewhat bigger (ex: 3069). In the event that you need to, check the quantity of max clients (this sets the measure of synchronous most extreme clients on your work without a moment's delay performing activities - The more on immediately, 

the slower the association and the other way around). 

The beneath alternatives are then choosable: 

- Launch with windows 

- Activate FTP Server on Start-up 

- Put into the plate on startup 

- Allow different occurrences 

- Show "Loading..." status at startup 

- Scan drive(s) at startup 

- Confirm exit 

You can do what you need with these, as they are quite obvious. The sweep drive include is pleasant, as 

is the second and the last choice. From here, click the 'choices' text on the left section. 

To secure your worker, you should check 'login check' and 'secret key check', 'Show relative way (a must!)', 

what's more, some other choices you feel you'll require. Subsequent to doing as such, click the 'progressed' text in the left segment. You should then leave the support size on the default (except if obviously, you comprehend what you're doing ), and afterward, permit the sort of FTP you need. 

Transferring and downloading is normally acceptable, however, it's up to you in the event that you need to permit transfers or potentially downloads. 

For the worker need, that will decide how much ordinary memory will be utilized and how much 'exertion' 

will go into making your worker run easily. 

Against pounding is additionally acceptable, as it keeps individuals from hindering your speed. From here, click 'Log 

Choices' from the left segment. In the event that you might want to see and record each and every order and jumble up your screen, leave the defaults.

In any case, in the event that you might want to perceive what is new with the least conceivable space taken, click 'Screen' in the top section. You should then verify 'Log effective logins', and the entirety of the alternatives in the customer directory, 

but 'Log registry changes'. Subsequent to doing as such, click 'alright' in the base left corner. 

You will at that point need to go into 'Arrangement - > User Accounts' (or ctrl and u). From here, you should tap on the privilege of the most segment and right snap. Pick 'Include', and pick the username(s) you might want individuals to approach 


Subsequent to giving a name (ex: themoonlanding), you should give them a set secret phrase in the base section (ex: 

was faked). For the 'Home IP' registry, (on the off chance that you enrolled with a static worker, check 'All IP Homes'. In the event that your 

IP is static of course, pick your IP from the rundown. You will at that point need to right snap in the extremely focus section, and pick 'Include'. 

From here, you should set the index you need individuals to approach. In the wake of picking the index, I propose you pick the choices 'Read', 'Rundown', and 'subdirs', except if obviously, guess what you're doing. In the wake of doing as such, cause a 'to transfer' envelope in the registry, and decide to 'include' this organizer separately to the middle segment. Pick 'compose', 'affix', 'make', 'list', and 'subdirs'. This will permit them 

to transfer just to explicit envelopes (your transfer organizer). 

Presently click on 'Different' from the left section. Pick 'empower account', your break (how long it requires for individuals to stay inert before you naturally kick them off), the most extreme number of clients for this name, 

the most extreme number of associations permitted at the same time for one IP address, show the relative way (an absolute necessity!), and some other things at the base you'd prefer to have. Presently click 'alright'. 


From this primary menu, click the small enclosing glove symbol the top corner, and right snap and unchoose the hit-o-meter for both transfers and downloads (with this you can screen IP action). Presently click the lightning 

jolt, and your worker is presently fully operational. 

Post your FTP data, similar to this: (or something different, for example, 'f*p://') 

Client: *** (The username of the customer) 

Pass: *** (The secret phrase) 

Port: *** (The port number you picked) 

So make an FTP and join the FTP segment 

Posting The Contents Of A Ftp: 

Posting the substance of an FTP is basic. 

You will require FTP Content Maker, which can be downloaded from here: 


1. Put in the IP of the worker. Try not to put "FTP://" or a "/" on the grounds that it won't work on the off chance that you do as such. 

2. Put in the port. On the off chance that the port is the default number, 21, you don't need to enter it. 

3. Put in the username and secret key in the proper fields. In the event that the login is unknown, you don't need to 

enter it. 

4. On the off chance that you need to list a particular registry of the FTP, place it in the catalog field. Something else, don't

enter anything in the directory field.
5. Click "Take the List!"

6. After the list has been taken, click the UBB output tab, and copy and paste to wherever you want it.

If FTP Content Maker is not working, it is probably because the server does not utilize Serv-U Software.
If you get this error message:
StatusCode = 550
LastResponse was : 'Unable to open local file test-ftp'
Error = 550 (Unable to open local file test-ftp)
Error = Unable to open local file test-ftp = 550
Close and restart FTP Content Maker, then try again.


error messages:
110 Restart marker reply. In this case, the text is exact and not left to the particular implementation; it
must read: MARK yyyy = mmmm Where yyyy is the User-process data stream marker, and mmmm server's equivalent marker
(note the spaces between markers and "=").
120 Service ready in nnn minutes.
125 Data connection already open; transfer starting.
150 File status okay; about to open data connection.
200 Command okay.
202 Command not implemented, superfluous at this site.
211 System status, or system help reply.
212 Directory status.
213 File status.
214 Help message. On how to use the server or the meaning of a particular non-standard command. This reply is
useful only to the human user.
215 NAME system type. Where NAME is an official system name from the list in the Assigned Numbers document.
220 Service ready for a new user.
221 Service closing control connection. Logged out if appropriate.
225 Data connection open; no transfer in progress.
226 Closing data connection. Requested file action successful (for example, file transfer or file abort).
227 Entering Passive Mode (h1,h2,h3,h4,p1,p2).
230 User logged in, proceed.
250 Requested file action okay, completed.
257 "PATHNAME" created.
331 User name okay, need a password.
332 Need account for login.
350 Requested file action pending further information.
421 Too many users logged into the same account
425 Can't open data connection.
426 Connection closed; transfer aborted.
450 Requested file action not taken. File unavailable (e.g., file busy).
451 Requested action aborted: local error in processing.
452 Requested action not taken. Insufficient storage space in the system.
500 Syntax error, command unrecognized. This may include errors such as the command line too long.
501 Syntax error in parameters or arguments.
502 Command not implemented.
503 Bad sequence of commands.
504 Command not implemented for that parameter.
530 Not logged in.
532 Need account for storing files.
550 Requested action not taken. File unavailable (e.g., file not found, no access).
551 Requested action aborted: page type unknown.
552 Requested file action aborted. Exceeded storage allocation (for current directory or dataset).
553 Requested action not taken. Filename not allowed.


Active FTP vs. Passive FTP, a Definitive Explanation

One of the most commonly seen questions when dealing with firewalls and other Internet connectivity issues are
the difference between active and passive FTP and how best to support either or both of them. Hopefully, the
following text will help to clear up some of the confusion over how to support FTP in a firewalled

This may not be the definitive explanation, as the title claims, however, I've heard enough good feedback and
seen this document linked in enough places to know that quite a few people have found it to be useful. I am
always looking for ways to improve things though, and if you find something that is not quite clear or needs
more explanation, please let me know! Recent additions to this document include the examples of both active
and passive command line FTP sessions. These session examples should help make things a bit clearer. They also
provide a nice picture of what goes on behind the scenes during an FTP session. Now, on to the

The Basics
FTP is a TCP based service exclusively. There is no UDP component to FTP. FTP is an unusual service in that it
utilizes two ports, a 'data' port and a 'command' port (also known as the control port). Traditionally these
are port 21 for the command port and port 20 for the data port. The confusion begins however when we find
that depending on the mode, the data port is not always on port 20.

Active FTP
Inactive mode FTP, the client connects from a random unprivileged port (N > 1024) to the FTP server's command
port, port 21. Then, the client starts listening to port N+1 and sends the FTP command PORT N+1 to the FTP
server. The server will then connect back to the client's specified data port from its local data port, which
is port 20.

From the server-side firewall's standpoint, to support active mode FTP the following communication channels
need to be opened:

FTP server's port 21 from anywhere (Client initiates connection)
FTP server's port 21 to ports > 1024 (Server responds to client's control port)
FTP server's port 20 to ports > 1024 (Server initiates data connection to client's data port)
FTP server's port 20 from ports > 1024 (Client sends ACKs to server's data port)

In step 1, the client's command port contacts the server's command port and sends the command PORT 1027. The
server then sends an ACK back to the client's command port in step 2. In step 3 the server initiates a
connection on its local data port to the data port the client specified earlier. Finally, the client sends an
ACK back as shown in step 4 

The main problem with active mode FTP actually falls on the client-side. The FTP client doesn't make the
actual connection to the data port of the server--it simply tells the server what port it is listening on and
the server connects back to the specified port on the client. From the client-side firewall, this appears to be
an outside system initiating a connection to an internal client--something that is usually blocked.

Active FTP Example
Below is an actual example of an active FTP session. The only things that have been changed are the server
names, IP addresses, and user names. In this example, an FTP session is initiated from
(, a linux box running the standard FTP command-line client, to
(, a linux box running ProFTPd 1.2.2RC2. The debugging (-d) flag is used with the FTP client to
show what is going on behind the scenes. Everything in red is the debugging output which shows the actual FTP
commands being sent to the server and the responses generated from those commands. Normal server output is
shown in black, and user input is in bold.

There are a few interesting things to consider about this dialog. Notice that when the PORT command is issued,
it specifies a port on the client ( system, rather than the server. We will see the opposite
behavior when we use passive FTP. While we are on the subject, a quick note about the format of the PORT
command. As you can see in the example below it is formatted as a series of six numbers separated by commas.
The first four octets are the IP address while the second two octets comprise the port that will be used for
the data connection. To find the actual port multiply the fifth octet by 256 and then add the sixth octet to
the total. Thus in the example below the port number is ( (14*256) + 178), or 3762. A quick check with netstat
should confirm this information.

testbox1: {/home/p-t/slacker/public_html} % ftp -d testbox2
Connected to
220 FTP server ready.
Name (testbox2:slacker): slacker
---> USER slacker
331 Password required for a slacker.
Password: TmpPass
230 User slacker logged in.
---> SYST
215 UNIX Type: L8
The remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
ftp: setsockopt (ignored): Permission denied
---> PORT 192,168,150,80,14,178
200 PORT command successful.
---> LIST
150 Opening ASCII mode data connection for file list.
drwx------ 3 slacker users 104 Jul 27 01:45 public_html
226 Transfer complete.
ftp> quit
---> QUIT
221 Goodbye.

Passive FTP
In order to resolve the issue of the server initiating the connection to the client, a different method for FTP connections was developed. This was known as passive mode, or PASV, after the command used by the client to tell the server it is in passive mode.

In aloof mode FTP, the customer starts the two associations with the worker, tackling the issue of firewalls sifting the approaching information port association with the customer from the worker. When opening an FTP association, the customer opens two arbitrary unprivileged ports locally (N > 1024 and N+1). The main port contacts the worker on port 21, yet rather than giving a PORT order and permitting the worker to associate back to its information port, 

the customer will give the PASV order. The aftereffect of this is the worker at that point opens an arbitrary unprivileged port (P > 1024) and sends the PORT P order back to the customer. The customer at that point starts the association from port N+1 to port P on the worker to move information. 

From the worker side firewall's outlook, to help uninvolved mode FTP the accompanying correspondence channels 

should be opened: 

FTP worker's port 21 from anyplace (Client starts association) 

FTP worker's port 21 to ports > 1024 (Server reacts to customer's control port) 

FTP worker's ports > 1024 from anyplace (Client starts information association with irregular port indicated by worker) 

FTP worker's ports > 1024 to far off ports > 1024 (Server sends ACKs (and information) to customer's information port) 

In sync 1, the customer contacts the worker on the order port and issues the PASV order. The worker at that point 

answers in sync 2 with PORT 2024, telling the customer which port it is tuning in to for the information association. In 

stage 3 the customer at that point starts the information association from its information port to the predetermined worker information port. 

At last, the worker sends back an ACK in sync 4 to the customer's information port. 

While detached mode FTP tackles huge numbers of the issues from the customer side, it opens up an entire scope of issues on the worker side. The greatest issue is the need to permit any far off association with high numbered ports on the worker. Luckily, many FTP daemons, including the mainstream WU-FTPD permit the manager to determine a 

scope of ports that the FTP worker will utilize. See Appendix 1 for more data. 

The subsequent issue includes supporting and investigating customers which do (or don't) uphold detached mode. As 

a model, the order line FTP utility gave Solaris doesn't uphold aloof mode, requiring a 

outsider FTP customer, for example, ncftp. 

With the huge notoriety of the World Wide Web, numerous individuals like to utilize their internet browser as an FTP 

customer. Most programs possibly uphold inactive mode when getting to ftp://URLs. This can either be positive or negative contingent upon what the workers and firewalls are designed to help. 

Aloof FTP Example 

The following is a genuine case of an inactive FTP meeting. The main things that have been changed are the worker names, IP locations, and client names. In this model, an FTP meeting is started from 

(, a linux box running the standard FTP order line customer, to 

(, a linux box running ProFTPd 1.2.2RC2. The troubleshooting (- d) banner is utilized with the FTP customer to show what is happening in the background. Everything in red is the investigating yield which shows the real FTP 

orders being sent to the worker and the reactions produced from those orders. Typical worker yield appears in dark, and client input is strong. 

Notice the distinction in the PORT order in this model rather than the dynamic FTP model. Here, we see a 

port being opened on the worker ( framework, as opposed to the customer. See the conversation about the organization of the PORT order above, in the Active FTP Example segment.

testbox1: {/home/p-t/slacker/public_html} % ftp -d testbox2
Connected to
220 FTP server ready.
Name (testbox2:slacker): slacker
---> USER slacker
331 Password required for slacker.
Password: TmpPass
230 User slacker logged in.
---> SYST
215 UNIX Type: L8
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> passive
Passive mode on.
ftp> ls
ftp: setsockopt (ignored): Permission denied
---> PASV
227 Entering Passive Mode (192,168,150,90,195,149).
---> LIST
150 Opening ASCII mode data connection for file list
drwx------ 3 slacker users 104 Jul 27 01:45 public_html
226 Transfer complete.
ftp> quit
---> QUIT
221 Goodbye.

The following chart should help admins remember how each FTP mode works:

Active FTP :
command : client >1024 -> server 21
data : client >1024 <- server 20

Passive FTP :
command : client >1024 -> server 21
data : client >1024 -> server >1024