FTP



Das File Transfer Protocol (FTP) stellt die grundlegenden Elemente des File-Sharings zwischen Hosts zur Verfügung. FTP benutzt TCP, um eine virtuelle Verbindung für Kontrollinformationen zu schaffen und schafft dann eine separate TCP-Verbindung für Datentransfers.

Commands:


Command

Description

References

ABOR

Abort a file transfer.

 

ACCT <account>

Send account information.

 

ADAT

Authentication/Security Data.

RFC 2228

ALLO <bytes>

Allocate.

 

APPE <filename>

Append to a remote file.

 

AUTH

Authentication/Security Mechanism.

RFC 2228

CCC

Clear Command Channel.

RFC 2228

CDUP <dir path>

Change to parent directory.

RFC 959

CONF

Confidentiality Protected Command.

RFC 2228

CWD <dir path>

Change working directory.

RFC 697

DELE <filename>

Delete a remote file.

 

ENC

Privacy Protected Command.

RFC 2228

EPRT

Extended Data port.

RFC 2428

EPSV

Extended Passive.

RFC 2428

FEAT

Feature.

RFC 2389

HELP <command>

Return help on using the server.

 

HOST <host>

Set virtual host name

 

LANG

Language negotiation.

RFC 2640

LIST <name>

List long dir/file-information.

 

LPRT

Long data port.

RFC 1639

LPSV

Long passive.

RFC 1639

MDTM

Return the modification time of a file.

 

MIC

Integrity Protected Command.

RFC 2228

MKD <directory>

Make a remote directory.

RFC 959

MLSD <directory>

Name list of remote directory.

 

MODE <mode>

Set transfer mode. (S=stream, B=block, C=compressed)

 

NLST <directory>

Name list of remote directory.

 

NOOP

No operation.

 

OPTS

Options.

RFC 2389

PASS <password>

Send password.

 

PASV

Enter passive mode.

 

PBSZ

Protection Buffer Size.

RFC 2228

PORT <address>

Open a Data port (h1,h2,h3,h4,p1,p2).

 

PROT

Data Channel Protection Level.

RFC 2228

PWD

Print working directory.

RFC 959

QUIT

Logout (terminate the connection).

 

REIN

Reinitialize the connection.

 

REST <offset>

Restart.

 

RETR <filename>

Retrieve a remote file.

 

RMD <directory>

Remove a remote directory.

RFC 959

RNFR <old path>

Rename from.

 

RNTO <new path>

Rename to.

 

SITE <params>

Site parameters (site-specific commands).

 

SIZE <filename>

Return the size of a file .

 

SMNT <pathname>

Structure mount.

RFC 959

STAT <directory>

Return server status.

 

STOR <filename>

Store a file on the remote host.

 

STOU <filename>

Store a file unique.

RFC 959

STRU <type>

Set file transfer structure (F=file, R=record, P=page).

 

SYST

return system type.

RFC 959

TYPE <data type>

Set transfer type (A=ASCII, E=EBCDIC, I=binary).

 

USER <username>

Send user name for system log-in.

 

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

extension to FTP mail (Now incorporated into SMTP, RFC 788)

RFC 743

XRMD

Remove the directory.

RFC 775

XRSQ

extension to FTP mail (Now incorporated into SMTP, RFC 788)

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

213

(File status reply.)

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. File unavailable (file busy)

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. File unavailable (not found, no access).

551

Requested action aborted. Page type unknown.

552

Requested file action aborted.

553

Requested action not taken. File name not allowed.

554

Requested action not taken: invalid REST parameter.

555

Requested action not taken: type or stru mismatch.




LIST information in UNIX-style format:


Im nachfolgenden Format wird jeder Eintrag bei Verwendung des UNIX List-Formates zum Client übermittelt.

attribs

links

owner

group

size

date & time/year

name

CR/LF



spacer (0x20)

1 byte

attribs

attributes of this entry (type/owner/group/anyone)

10 bytes

links

link counter (right justified)

3..5 bytes

owner

owner name (left justified)

8..10 bytes

group

group name (left justified)

8..10 bytes

size

size of this entry (right justified)

7..10 bytes

date & time/year

creation/last-change date & time/year (left justified)

12 bytes

name

name of this entry (no filling)

1..255 bytes

CR/LF

end-of-line (0x0D & 0x0A)

2 byte



attributes :

type

owner

group

anyone

-

r w x

r w x

r w x


• type (first character)


-

the entry is a ordinary file

b

the entry is a block special file

c

the entry is a character special file

d

the entry is a directory

l

the entry is a symbolic link

p

the entry is a FiFo special file (pipe)

s

the entry is a local socket


• owner / group / anyone (a 3 bytes)


r

read

w

write (edit)

x

execute (search)

-

corresponding permission not granted


link counter :

Zahl der Links zu diesem Eintrag. Die Größe dieses Feldes ist 3..5 Zeichen mit Leerzeichen plus rechts orientiertem Wert, wie "  1".



owner name :

Name des Eigners dieses Eintrages. Dies ist der User-Profil Name des Eintrageigners. Die Größe dieses Feldes ist 8..10 Zeichen mit links orientiertem String plus auffüllenden Lerrzeichen, wie "ftp     ".



group name :

Name der Gruppe des Eigners dieses Eintrages. Dies ist der Gruppen-Profil Name des Eintrageigners. Die Größe dieses Feldes ist 8..10 Zeichen mit links orientiertem String plus auffüllenden Lerrzeichen, wie "service ".



size :

Größe des Eintrages in Bytes. Die Größe dieses Feldes selbst ist 7..10 Zeichen mit Leerzeichen plus rechts orientiertem Wert in Dezimalangabe, wie "      1024". Verzeichnisse haben immer die Größe 0.



date & time/year :

Änderungs-Zeit dieses Eintrages. Die Größe dieses Feldes ist fest 12 Zeichen mit links orientierem Werten in folgenden Format.



• letzte Änderung innerhalb der letzten 180 Tage

"Mmm dd hh:mm"



• letzte Änderung älter als 180 Tage

"Mmm dd  yyyy"



mit nachfolgender Beschreibung der Elemente:

Mmm

abbreviated month ("Jan", Feb", ..)

dd

day of the month, right justified and padded with blank (" 1" .. "31")

hh

hour, right justified and padded with ZERO ("00" .. "23")

mm

minute, right justified and padded with ZERO ("00" .. "59")

yyyy

year, right justified but alltimes 4 characters ("1980" ..)



name :

Der Name des Eintrages. Dieses Feld hat eine variable Länge, abhängig vom der Länge des Namens dieses Eintrages incl. enthaltenen Leerzeichen. Nach diesem Element (diesem Eintrag) wird die Zeile geschlossen (ohne Spacer) mit CR+LF.



Beispiel:

"drwxr--r--   1 ftp     service       0 Jul  8  2005 images"
"-rw-r--r--   1 ftp     service    2038 Aug 16 09:23 index.html"