You are on page 1of 3

Hello, This is a tutorial for ftp.

What is FTP?
FTP is short for File Transfer Protocol. A protocol is a set of rules that networked
computers use to talk to one another. And FTP is the language that computers on a
TCP/IP network (such as the internet) use to transfer files to and from each other.

You’ve probably encountered FTP out there on the net already. Ever downloaded a
fresh nightly build of Firefox or grabbed MP3s from some kid’s personal server in
Sweden? Then you have probably used FTP without even knowing it. Today’s web
browsers allow you to download files via FTP from within the browser window. It’s
very convenient, and it’s great for those times you need to download a file or two, but
the browser-download method does not offer much in the realm of flexibility. You
can’t upload, force a particular transfer mode, or ask the server any questions. And
don’t even get me started on the security issue. But if you are doing any sort of web
development, you need all this functionality.
The best way to pursue file transfers is with a bona fide FTP client. You use an FTP
client to log into an FTP server, navigate the server’s folder structure, and exchange
files. That’s pretty much all FTP clients do — unlike Web browsers, FTP clients are
tailor-made for such duties. The latest full-featured web editors
like Dreamweaver and RapidWeaver have FTP fuctions built-in. As far as stand-alone
FTP clients go, there are literally hundreds out there. Some are free, some are more
expensive than a night on the town.
We’ll take an in-depth look at the joy of using an FTP client in the pages that follow,
but first, let’s look at exactly how an FTP session works.

Logging In
Connecting to an FTP server is very similar to connecting to just about any other
server on the Web. When you log in to your Hotmail account or a secure shopping cart
system (such as the one at Amazon.com), you have to provide a server address, a user
name, and a password before you can exchange information with the server.

Let’s take a look at an example login set for an FTP server.

site:ftp.fakesite.org login:mcalore pass:h4x0r4lyfe port:21


The first line in the example above, the site address, is simply the address of the FTP
server that I’m connecting to. The “ftp” in the prefix of the URL identifies it as an
FTP server. Pretty straightforward so far. The second and third lines are my user name
and password, respectively. In this particular case, I have already had the server
administrator set up a login account for me on the server. Even if I didn’t have a login
account, I still might be able to gain access to the server by logging in anonymously.
We’ll go into that more a little later.

The last line of the example login is the port number that I’m connecting to on the
server. A port is best envisioned as a little door on the server. Most servers on the web
have a multitude of such doors, each with its own purpose. Each port number is
dedicated to a corresponding application on the server, and the traffic intended for an
application (such as an FTP server or web server) passes through the application’s
dedicated door. Each port handles a specific type of transaction between the server
and client. For example, the FTP protocol is handled by ports 20 and 21 by default.
HTTP (the protocol that’s used to serve web pages to a browser) requests are handled
by port 80.

Often, the port number will be attached to the end of the server’s Web address,
separated by a colon, like this:

ftp.fakesite.org:21
It isn’t important that you know every single TCP/IP port for each internet application
out there, but you have to be able to recognize a port number when you see one. This
becomes especially critical when you are connecting to servers that route FTP
connections to other, more obscure ports.
Note: This quandry brings up the sometimes-confusing issue of passive FTP versus
active FTP, two different modes of data transfer between a client and a server. Which
one is being used depends on how the client and server firewalls are set up. Since this
issue is beyond the scope of this article, I will point you to a detailed discussion of
active versus passive FTP over at Slacksite.com. So don’t be alarmed if you notice
that your FTP connection is jumping to port 1013 all of sudden — that’s just your data
being routed via passive FTP.

Anonymous FTP
Many public servers on the Internet allow users to log in and download files via FTP
by connecting anonymously. This is a very common practice in the world of open-
source and freely distributed software.
When you connect anonymously to an FTP server, you’re not really anonymous in the
truest sense. Most of the time, you are required to enter “anonymous” as your user
name and your email address as your password. This is a gesture of courtesy toward
the server administrators so that they can get some idea of who’s logging in and
downloading their files. Even if you are connecting anonymously and you aren’t
required to give any personal information during the connection process, any
sysadmin worth her salt is logging your session. This means that if you do anything
nasty or illegal, the server administrator has your number (quite literally, your host
domain and IP address). You can be put on probation, blocked, or prosecuted. So,
here’s a tip to remember:anonymous is never really anonymous as far as anonymous
FTP is concerned.

You might also like