Sidebar: A Sample ftp Session with the -d Option
By default the ftp command on both SVR4 and SunOS systems
is in the verbose mode, which means that the server's
replies
are shown. Setting the -d option causes all of the data
to
be available on the screen. The following shows such
an ftp session:
1: $ ftp -d
2: ftp> open localhost
3: Connected to localhost.
4: 220 drama FTP server (UNIX(r) System V Release 4.0) ready.
5: Name (localhost:dianne):
6: ---> USER dianne
7: 331 Password required for dianne.
8: Password:
9: ---> PASS abc123
10: 230 User dianne logged in.
11: ftp> ls
12: ---> PORT 127,0,0,1,4,26
13: 200 PORT command successful.
14: ---> NLST
15: 150 ASCII data connection for /bin/ls (127.0.0.1,1024) (0 bytes).
16: file1
17: file2
18: 226 ASCII Transfer complete.
19: 14 bytes received in 0.02 seconds (0.68 Kbytes/s)
20: ftp> quit
21: ---> QUIT
22: 221 Goodbye.
23: $
Line 1 is the user request to start an ftp session with
the -d,
debug, option.
Line 2 is the user command to start a connection to
the ftp port on
the host localhost. Line 3 is ftp informing the user
the connection
is made. Line 4 is an echo of the reply code coming
from the server.
The 220 command tells the client machine to send the
next command.
Line 5 is ftp requesting the account name to use in
the ftp session.
The material in parenthesis is the default if an enter
key
is pressed. Line 6 shows the USER command sent to the
server.
Line 7, the 331 reply, is the reply to line 6. The first
3 of the
code is a Positive Intermediate response. The second
3 shows that
the response concerns authentication. Looking up the
1 code in RFC
959 shows the account name is okay and that a password
is required.
The text accompanying the reply code indicates this.
Line 8 is ftp asking the user for the password. Line
9 shows that
the password is sent across the network in clear text.
Since ftp is
designed to be operating system-independent, the easiest
thing to
do is to send the password to the server and let it
do the authentication.
Line 10 is the reply to the PASS command of line 9.
Line 11 is an ls command issued by the user. If the
ftp program does
not want the data coming back on its control port, it
issues a PORT
command, line 12. Line 13, reply code 200, shows the
server was able
to set up a new port for sending data. If the port cannot
be set up
in 60 seconds, the server times out the connection and
returns a reply
code 425, "Can't open data connection," to
the client. This
reply code implies that the command can be re-issued
exactly as it
was given. The 150 reply code of line 15 means that
the data is ready
to be transferred on the data connection. The ASCII
string shows the
command used to obtain the data from the file system.
Lines 16 and
17 show the data being transferred. The 226 reply code
of line 18
shows all data is transferred and the data connection
is closed. Line
19 is from the client ftp program showing how much data
was received
from the server.
Line 20 is the user issuing a quit command to the ftp
program. Line
21 shows the QUIT command being transferred to the server.
Line 22 is the reply code 221 showing the server is
closing the control
connection.
|