Skip to content

File Transfer Protocol (FTP)

Find and read RFC959 for FTP (Key idea has been discussed in the class) and list all of the client commands that are supported by the RFC. - List all of the FTP client commands - Interactive with FTP Server - Get RFC 959 by Archive and Ftp

Concept

Users use below applications

  • Ftp clients (e.q. cute-Ftp; ws_ftp...) to access the Ftp Servics.

but we will not use any client-side applications to access above Services. instead of telnet. it will help us to know more detail of FTP protocol.

Requirements

  • Red-Hat Linux 6.2 + KDE/X-window

FTP

Step-by-Step by using telnet to access FTP server

  • List all of the client commands that are supported by the RFC 595.
  • Connect to FTP Server (port 21) and list all commands users can use.
  • User has to login NTUT's Sun OS Server and telnet to NTUT's FTP Server. (Optional, if user wants to run FTP client on Sun OS Server)

  • Issue below command on Terminal to access NTUT FTP Server after login NTUT Sun OS Server.

telnet 140.124.13.2 21
  • Issue below FTP commands trying to list file(s) from NTUT FTP Server
# PROMPT DESCRIPTION
1 user s9360511 โŽ Identify yourself to the remote FTP server (please use your personal account)
2 pass โŽ Issue the password to FTP Server(please use your personal password)
3 HELP โŽ List all FTP commands
4 PWD โŽ Print the name of the current working directory on the remote machine, in this case we saw /user/student/s9360/s9360511
5 list โŽ Print a listing of the contents of a directory on the remote machine under folder /user/student/s9360/s9360511, but it will pop up a warnnig message saying 425 Can't build data connection: Connection refused.

Screenshot

  • Screenshot of running telenet

result

Download The File

Step-by-Step

  • In above case, When users issue LIST command, Server responses 425 Can't open data connection.

  • Refer to Richard Stevens TCP/IP Illustrated vo1.1 CH27 FTP: File Transfer Protocol, Server has to open Data Channel for Data Connection.

  • Terminal 1: Issue below command to access NTUT FTP Server (Command Port)

    telnet 140.124.13.2 21
    

  • Terminal 1: Issue below command on Command Port find out Data Port's number

STEP PROMPT DESCRIPTION
1 user s9360511 โŽ Identify yourself to the remote FTP server (please use your personal account)
2 pass โŽ Issue the password to FTP Server(please use your personal password)
3 PWD โŽ Print the name of the current working directory on the remote machine, in this case we saw /user/student/s9360/s9360511
4 PASV โŽ Request the remote server open a port for the data connection and return the address of that port. In this case, 140,124,13,2,195,133, it means server opens Port 50033(195*256*133) for Data Connection
  • Terminal 2: Issue below command on Terminal 2 to access NTUT FTP Server.
telnet 140.124.13.2 21
  • Terminal 2: Issue below FTP commands on Terminal 2, accessing Port 50033.
telnet 140.124.13.2 50033
  • Terminal 1: Issue below command on Data port
STEP PROMPT DESCRIPTION
5 LIST โŽ ๅ›žๅˆฐๅŽŸๆœฌ็š„ FTP ๆŽงๅˆถๅŸ (21)ไธ‹ๅ‘ฝไปค

ๅœจ FTP ่ณ‡ๆ–™้€ฃๆŽฅๅŸ ็š„่ฆ–็ช—(Terminal 2)ๅณๅฏ็œ‹ๅˆฐไธ‹ LIST ๆŒ‡ไปค ๆ‰€ๅ›žๆ‡‰็š„่ณ‡ๆ–™,ๅ›žๆ‡‰ๅฎŒๅพŒไธปๆฉŸๅณๅฐ‡ๅŸ ๅฃ้—œ้–‰

  • Terminal 1: Issue below command on Data Port to say Goodbye to FTP Server
STEP PROMPT DESCRIPTION
6 QUIT โŽ Logout FTP Server

Screenshot

  • Screenshot of telenet

result

Debug Mode

Screenshot

  • Enable Debug Mode (with -d optional) when accessing FTP server.
ftp -d 140.124.13.2
  • User can observe and diagnostic the command when the FTP-Client issues to FTP-Server.

result

  • In the case, we learned ls command was the combination of PASV and LIST commands.

result

RFC 959

Get RFC 959 from any FTP Server

  • Try to find the ref959 document from NCU Archie Service.

result

  • Use NCTU FTP Server.

result

  • FTP to NCTU FTP Server.

result

  • Login with anonymous account, use Email Address as Login Password, list available command(s) by pressing help.

result

  • Listing all files.

result

  • Navigate to Documents/RFC, issue below command to fetch RFC file.
get rfc959.txt      #<= get file rfc959.txt
quit                #<= logout FTP server

result

  • Reading from the Editor.

result

Get RFC 959 from IEFT

  • We can found RFC from IETF Website also.
    result

  • Display RFC 0959
    result

Advanced

  • FTP Code 226
  • Closing data connection. Requested file action successful (file transfer, abort, etc.).
$author:   Jin-Wen (Ed) Lai
$date:     Oct. 2001
$revised:  Mar. 2018
$keywords: computer, networks, network, http, RFC.