FTP, File Transfer Protocol |
Description | Glossary | RFCs | Publications | Obsolete RFCs |
Protocol suite: | TCP/IP. |
Protocol type: | Application layer file transfer protocol. |
Ports: | 20 (TCP) default data; 21 (TCP) control. |
URI: | ftp: |
MIME subtype: | |
SNMP MIBs: | |
Working groups: |
cat, Common Authentication Technology.
ftpext, Extensions to FTP. |
Links: |
FTP uses the Telnet protocol on the control connection.
The FTP specification says that by default, all data transfers should be over a single connection. An active open is done by the server, from its port 20 to the same port on the client machine as was used for the control connection. The client does a passive open. For better or worse, most current FTP clients do not behave that way. A new connection is used for each transfer; to avoid running afoul of TCP's TIMEWAIT state, the client picks a new port number each time and sends a PORT command announcing that to the server.
MAC header | IP header | TCP header | FTP message |
FTP message format:
FTP commands are Telnet strings terminated by the Telnet end of line code. The command codes themselves are alphabetic character strings terminated by the character <Space> if parameters follow and <CRLF> otherwise.
FTP Commands:
Command | Description | References |
---|---|---|
ABOR | Abort. | |
ACCT | Account. | |
ADAT | Authentication/Security Data. | RFC 2228 |
ALLO | Allocate. | |
APPE | Append. | |
AUTH | Authentication/Security Mechanism. | RFC 2228 |
CCC | Clear Command Channel. | RFC 2228 |
CDUP | Change to parent directory. | RFC 959 |
CONF | Confidentiality Protected Command. | RFC 2228 |
CWD | Change working directory. | RFC 697 |
DELE | Delete. | |
ENC | Privacy Protected Command. | RFC 2228 |
EPRT | Extended Data port. | RFC 2428 |
EPSV | Extended Passive. | RFC 2428 |
FEAT | Feature. | RFC 2389 |
HELP | Help. | |
LANG | Language negotiation. | RFC 2640 |
LIST | List. | |
LPRT | Long data port. | RFC 1639 |
LPSV | Long passive. | RFC 1639 |
MDTM | File modification time. | RFC 3659 |
MIC | Integrity Protected Command. | RFC 2228 |
MKD | Make directory. | RFC 959 |
MLSD | RFC 3659 | |
MLST | RFC 3659 | |
MODE | Transfer mode. | |
NLST | Name list. | |
NOOP | No operation. | |
OPTS | Options. | RFC 2389 |
PASS | Password. | |
PASV | Passive mode. | |
PBSZ | Protection Buffer Size. | RFC 2228 |
PORT | Data port. | |
PROT | Data Channel Protection Level. | RFC 2228 |
PWD | Print working directory. | RFC 959 |
QUIT | Logout. | |
REIN | Reinitialize. | |
REST | Restart of interrupted transfer. | RFC 3659 |
RETR | Retrieve. | |
RMD | Remove directory. | RFC 959 |
RNFR | Rename from. | |
RNTO | Rename to. | |
SITE | Site parameters. | |
SIZE | File size. | RFC 3659 |
SMNT | Structure mount. | RFC 959 |
STAT | Status. | |
STOR | Store. | |
STOU | Store unique. | RFC 959 |
STRU | File structure. | |
SYST | System. | RFC 959 |
TYPE | Representation type. | |
USER | User name. | |
XCUP | Change to the parent of the current working directory. | RFC 775 |
XMKD | Make a directory. | RFC 775 |
XPWD | Print the current working directory. | RFC 775 |
XRCP | RFC 743 | |
XRMD | Remove the directory. | RFC 775 |
XRSQ | RFC 743 | |
XSEM | Send, Mail if cannot. | RFC 737 |
XSEN | Send to terminal. | RFC 737 |
FTP reply code format:
Code | Description |
---|---|
1yz | Positive Preliminary reply. |
2yz | Positive Completion reply. |
3yz | Positive Intermediate reply. |
4yz | Transient Negative Completion reply. |
5yz | Permanent Negative Completion reply. |
x0z | Syntax. These replies refer to syntax errors, syntactically correct commands that don't fit any functional category, unimplemented or superfluous commands. |
x1z | Information. These are replies to requests for information, such as status or help. |
x2z | Connections. Replies referring to the control and data connections. |
x3z | Authentication and accounting. Replies for the login process and accounting procedures. |
x4z | File system. These replies indicate the status of the Server file system vis-a-vis the requested transfer or other file system action. |
x5z |
FTP reply codes:
Code | Description |
---|---|
110 | Restart marker reply. |
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. |
215 | NAME system type. |
220 | Service ready for new user. |
221 | Service closing control connection. |
225 | Data connection open; no transfer in progress. |
226 | Closing data connection. |
227 | Entering Passive Mode <h1,h2,h3,h4,p1,p2>. |
228 | Entering Long Passive Mode. |
229 | Extended Passive Mode Entered. |
230 | User logged in, proceed. |
250 | Requested file action okay, completed. |
257 | "PATHNAME" created. |
331 | User name okay, need password. |
332 | Need account for login. |
350 | Requested file action pending further information. |
421 | Service not available, closing control connection. |
425 | Can't open data connection. |
426 | Connection closed; transfer aborted. |
450 | Requested file action not taken. |
451 | Requested action aborted. Local error in processing. |
452 | Requested action not taken. |
500 | Syntax error, command unrecognized. |
501 | Syntax error in parameters or arguments. |
502 | Command not implemented. |
503 | Bad sequence of commands. |
504 | Command not implemented for that parameter. |
521 | Supported address families are <af1, .., afn> |
522 | Protocol not supported. |
530 | Not logged in. |
532 | Need account for storing files. |
550 | Requested action not taken. |
551 | Requested action aborted. Page type unknown. |
552 | Requested file action aborted. |
553 | Requested action not taken. |
554 | Requested action not taken: invalid REST parameter. |
555 | Requested action not taken: type or stru mismatch. |
Access controls.
(RFC 959)
Access controls define users' access privileges to the use of a system, and to the files in that system.
Access controls are necessary to prevent unauthorized or accidental use of files.
It is the prerogative of a server-FTP process to invoke access controls.
Anonymous FTP.
This is the ability of an FTP client to connect to an FTP server with minimal authentication and gain access to public files.
Security problems may arise when such a user can read all files on the system or can create files.
DTP, data transfer process.
The DTP establishes and manages the data connection.
It can be active or passive.
Page.
(RFC 959)
A file may be structured as a set of independent parts called pages.
FTP supports the transmission of discontinuous files as independent indexed pages.
RFCs:
[RFC 114] A FILE TRANSFER PROTOCOL.
[RFC 281] A suggested Addition to File Transfer Protocol.
[RFC 354] THE FILE TRANSFER PROTOCOL.
[RFC 385] COMMENTS ON THE FILE TRANSFER PROTOCOL (RFC 354).
[RFC 412] User FTP Documentation.
[RFC 414] FILE TRANSFER PROTOCOL (FTP) STATUS AND FURTHER COMMENTS.
[RFC 430] COMMENTS ON FILE TRANSFER PROTOCOL.
[RFC 438] FTP Server-Server Interaction.
[RFC 454] FILE TRANSFER PROTOCOL - Meeting Announcement and a New Proposed Document.
[RFC 458] Mail Retrieval via FTP.
[RFC 463] FTP Comments and Response to RFC 430.
[RFC 468] FTP DATA COMPRESSION.
[RFC 475] FTP and the Network Mail System.
[RFC 478] FTP Server-Server Interaction-II.
[RFC 479] Use of FTP by the NIC Journal.
[RFC 480] Host-Dependent FTP Parameters.
[RFC 506] An FTP Command-Naming Problem.
[RFC 529] A Note on Protocol Synch Sequences.
[RFC 542] File Transfer Protocol for the ARPA Network.
[RFC 571] Tenex FTP Problem.
[RFC 573] Data and File Transfer - Some Measurement Results.
[RFC 593] Telnet and FTP Implementation Schedule Change.
[RFC 614] Response to RFC 607, "Comments on the File Transfer Protocol".
[RFC 624] Comments on the File Transfer Protocol.
[RFC 630] FTP Error Code Usage for More Reliable Mail Service.
[RFC 640] Revised FTP Reply Codes.
[RFC 697] CWD Command of FTP.
[RFC 737] FTP Extension: XSEN.
[RFC 743] FTP extension: XRSQ/XRCP.
[RFC 775] DIRECTORY ORIENTED FTP COMMANDS.
[RFC 949] FTP UNIQUE-NAMED STORE COMMAND.
[RFC 959] File Transfer Protocol (FTP).
[RFC 1123] Requirements for Internet Hosts -- Application and Support.
[RFC 1415] FTP-FTAM Gateway Specification.
[RFC 1579] Firewall-Friendly FTP.
[RFC 1635] How to Use Anonymous FTP.
[RFC 1639] FTP Operation Over Big Address Records (FOOBAR).
[RFC 2228] FTP Security Extensions.
[RFC 2389] Feature negotiation mechanism for the File Transfer Protocol.
[RFC 2428] FTP Extensions for IPv6 and NATs.
[RFC 2577] FTP Security Considerations.
[RFC 2585] Internet X.509 Public Key Infrastructure Operational Protocols: FTP and HTTP.
[RFC 2640] Internationalization of the File Transfer Protocol.
[RFC 2773] Encryption using KEA and SKIPJACK.
[RFC 3027] Protocol Complications with the IP Network Address Translator.
[RFC 3659] Extensions to FTP.
[RFC 4217] Securing FTP with TLS.
[RFC 172] THE FILE TRANSFER PROTOCOL.
[RFC 264] THE DATA TRANSFER PROTOCOL.
[RFC 265] THE FILE TRANSFER PROTOCOL.
[RFC 607] Comments on the File Transfer Protocol.
[RFC 765] FILE TRANSFER PROTOCOL.
[RFC 1545] FTP Operation Over Big Address Records (FOOBAR).
[RFC 1738] Uniform Resource Locators (URL).
Description | Glossary | RFCs | Publications | Obsolete RFCs |