Sometimes, the easiest way to wrap your head around a new concept is to dig in and examine the bare bones. In this case, we can learn a lot by simply reading the log from an FTP session.
All FTP servers and clients will log FTP sessions. A log is basically a text record of all of the activity that goes on during a session. Your client should save your FTP logs locally, so you can open them up in a text editor and have a peek at all the nitty-gritty FTP commands and transfer hoo-hah.
Let's take a look at a sample FTP log. I'm logging in to my server with the user name "mcalore". This log simply shows my client connecting to the server, logging in, and asking for the list of files inside the default directory on the server. That's all that's going on here!
Status: Connecting to ftp.fakesite.org ...
Status: Connected with ftp.fakesite.org.
Response: 220 ProFTPD 1.2.4 Server (ProFTPD) [109.41.xx.xxx]
Command: USER mcalore
Response: 331 Password required for mcalore.
Command: PASS **********
Response: 230 User mcalore logged in.
Status: Connected
Status: Retrieving directory listing...
Command: PWD
Response: 257 "/users/mcalore" is current directory.
Command: LIST
Response: 150 Opening ASCII mode data connection for file list.
Response: 226 Transfer complete.
Status: Directory listing successful
Starting at the beginning of the log, you can see that my FTP client wants to connect to the server at fakesite.org. My client knows that the server is active and waiting, so it sends the first command, which is "USER mcalore". The server says, "OK, but i need a password". My FTP client sends the next command, which is "PASS ********". This is all pretty simple my client sends a Command, and the server sends back a Response. The communication goes on like this during the entire session. It looks like my client and my server are becoming fast friends, eh?
There are several commands that a client can send to an FTP server to find out information, switch directories, or request files. In the sample log above, the PWD command which should be familiar to UNIX users is used to find out the current directory you're working in on the server. You can view a full list of FTP commands on Columbia University's Academic Information Systems site. Even though your client will take care of all the UNIX server commands for you, a good Monkey should be able to look at the logs and understand what's going on.
At this point, you're just about ready to grab your own FTP client and start experimenting. However, by showing you the sample FTP log, I opened a can of worms that we haven't discussed yet: transfer modes. "What's the deal with transfer modes?" you ask. Alright, I'll tell you.
next page»