본문 바로가기

Software/Network

[FTP] File Transfer Protocol

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.이전의 FTP 명령과 데이터 전송을 중지  
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
MIC Integrity Protected Command. RFC 2228
MKD Make directory. RFC 959
MODE Transfer mode.  
NLST Name list.  
NOOP No operation.  
OPTS Options. RFC 2389
PASS Password.  
PASV Passive.  
PBSZ Protection Buffer Size. RFC 2228
PORT Data port.클라이언트 IP 주소와 포트(n5x256+n6)  
PROT Data Channel Protection Level. RFC 2228
PWD Print working directory. RFC 959
QUIT Logout.  
REIN Reinitialize.  
REST Restart.  
RETR Retrieve.파일 검색(수신)  
RMD Remove directory. RFC 959
RNFR Rename from.  
RNTO Rename to.  
SITE Site parameters.  
SMNT Structure mount. RFC 959
STAT Status.  
STOR Store.파일 저장(송신)  
STOU Store unique. RFC 959
STRU File structure.  
SYST System.서버가 시스템 타입을 변환  RFC 959
TYPE

Representation type.파일 형태를 기술:

ASCII-> A, 이미지는 ->I

 
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 can't. RFC 737
XSEN Send to terminal. RFC 737

FTP reply code format:

Code Description
1yz 긍정적인 예비 응답  다른 응답을 수신하기를 기대하라는 응답
2yz 긍정적인 완성 응답, 새 명령을 보낼 수 있다.
3yz 긍정적인 중간 응답, 명령이 승인, 다른 추가 명령이 필요
4yz 순간적 부정 완성 응답 차후에 명령을 재실행 할 수 있다.
5yz 지속적인 부정 완성 응답 승인, 재시도 되지 않음.
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

명령 OK

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

사용자명 OK, 패스워드가 요구됨

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

구현되지 않은 MODE 형태

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.

Glossary:

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 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 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.

  • Defines FTP commands: AUTH, ADAT, PROT, PBSZ, CCC, MIC, CONF, ENC .

[RFC 2389] Feature negotiation mechanism for the File Transfer Protocol.

  • Defines FTP commands: FEAT and OPTS.

[RFC 2428] FTP Extensions for IPv6 and NATs.

  • Defines FTP commands: EPRT and EPSV.

[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.

  • Defines FTP command LANG.

[RFC 2773] Encryption using KEA and SKIPJACK.

[RFC 3027] Protocol Complications with the IP Network Address Translator.


Obsolete RFCs:

[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).


© 1998, 1999, 2000, 2001, 2002 Network Sorcery, Inc. All rights reserved.