Über das FTP Protokoll / About the FTP Protocol

in #deutsch3 years ago

Über das FTP Protokoll

(English Below / Englisch unten)

Das File Transfer Protocol (FTP) zu Deutsch "Dateiübertragungsverfahren" ist ein im RFC 959 von 1985 spezifiziertes Netzwerkprotokoll zur Übertragung von Dateien über IP-Netzwerke. FTP Arbeitet auf dem Application Layer (Schicht 7) des OSI Schichtenmodells. Es wird benutzt, um Dateien vom Server zum Client (Herunterladen) oder vom Client zum Server (Hochladen) zu Uebertragen. Mit FTP koennen auch Verzeichnisse angelegt und angezeigt werden.


FTP verwendet fuer die Steuerung und Datenübertragung jeweils separate Verbindungen. Eine FTP-Sitzung beginnt indem vom Client zum Control Port des Servers (üblicherweise Port 21) eine TCP-Verbindung aufgebaut wird. Über diese Verbindung werden Befehle zum Server gesendet und die entsprechenden Meldungen des Servers empfangen. Wenn ein Client eine Datei uebertragen will dann wird diese von Port 20 des Servers aus zum Client uebertragen bzw an Port 20 des Servers gesendet.


Es gibt zwei FTP Modis:

1. Aktives FTP

Beim aktiven FTP verbindet sich der Client mit dem Server(Port 21). Wenn der Client Daten vom Server anfordert baut der Server eine Datenverbindung von seinem Port 20 zum Client auf. Ein solche von Aussen eingehende Datenverbindung ist problematisch wenn der Client hinter Routern oder Firewalls steht. Das geht nur wenn die Konfiguration von Router/Firewall das zulässt.

2. Passives FTP

Bei passiven FTP öffnet der Client zwei Ports und teilt dies dem Server mit(PASV Kommando). Nachdem der Server geantwortet hat Initiert der Client die Verbindung mit seinem Daten Port. Da die Initiative fuer die Datenübertragung vom Client ausgeht funktioniert dieses Verfahren auch hinter Firewalls.


Weitere Details zu den bei FTP verwendeten Ports finden sich hier:
FTP Protokoll


FTP Server kennen zwei Modi zur Datenübertragung ascii und Binary. Beim Anmelden melden viele Server welcher Modus bei ihnen standartmässig aktiviert ist. z.b zeigt die Meldung "Using binary mode to transfer files" das die Dateien binär Übertragen werden. Das ist o.k. Sollte der Server aber melden das er ASCII Format verwendet dann muss das vor der Übertragung von Binär Dateien wie z.b iso oder exe Dateien geändert werden. Vorsicht ist auch immer angebracht wenn der Server überhaupt nicht meldet welche Übertragungsart er verwendet. Mit dem Kommando "type" kann bei bestehender FTP Verbindung überprüft werden was eingestellt ist. Mittels "type ascii" kann der Modus auf ascii umgestellt werden, wovon abzuraten ist. Sollte der Modus auf ascii eingestellt sein kann man ihn mit "type binary" auf binär umstellen was unbedingt anzuraten ist. Danach melden die Server oft "200 Type Set to I", das heisst das Daten Binaer uebertragen werden.
Um einen Server per FTP ansprechen zu können wird ein entsprechender Client benötigt. Es gibt viele davon, ein Programm mit einer grafischen Bedienoberfläche ist z.b FileZilla . Die simpelste (aber nicht einfachste) Variante per FTP Daten zu übertragen ist einen Kommandozeilen FTP Client zu verwenden. Diese werden mit den gaengigen Betriebssystemen mitgeliefert und müssen von der Kommandozeile (unter Windows cmd) gestartet werden. Mit:

ftp -p ftp.debian.de

wird die Verbindung im passiv mode aufgebaut. Auf Öffentlichen ftp Servern wie diesem ist es möglich anonymous als Loginname zu verwenden und eine E-Mail Adresse als Passwort.


English Version

About the FTP Protocol

The File Transfer Protocol (FTP) is a network protocol specified in RFC 959 in 1985 for the transfer of files over IP networks. FTP operates on the application layer (layer 7) of the OSI layer model. It is used to transfer files from server to client (download) or from client to server (upload). FTP can also be used to create and display directories.


FTP uses separate connections for control and data transfer. An FTP session starts by establishing a TCP connection from the client to the server's control port (usually port 21). This connection is used to send commands to the server and receive the corresponding messages from the server. If a client wants to transfer a file, it is transferred from port 20 of the server to the client.


There are two FTP modes:

1. active FTP

In active FTP, the client connects to the server (port 21). When the client requests data from the server, the server establishes a data connection from its port 20 to the client. Such an incoming data connection is problematic if the client is behind routers or firewalls. This is only possible if the router/firewall configuration allows it.

2. passive FTP

With passive FTP the client opens two ports and tells the server (PASV command). After the server responds, the client initiates the connection using its data port. Since the initiative for the data transfer comes from the client, this method also works behind firewalls.


More details about the ports used for FTP can be found here:

FTP Protokoll

FTP servers know two modes for data transfer ascii and binary. When logging in many servers report which mode is activated by default. e.g. the message "Using binary mode to transfer files" shows that the files are transferred binary. This is o.k. But if the server reports that it is using ASCII format then this must be changed before transferring binary files like iso or exe files. Be careful if the server doesn't report at all which transfer type it uses. With the command "type" it is possible to check what is set when the FTP connection is established. With "type ascii" the mode can be changed to ascii, which is not recommended. If the mode is set to ascii you can change it to binary with "type binary" which is strongly recommended. After that the servers often report "200 Type Set to I", which means that data is transferred binary.
To access a server via FTP you need a client. There are many of them, a program with a graphical user interface is e.g. FileZilla . The simplest (but not easiest) way to transfer data via FTP is to use a command line FTP client. These are delivered with the common operating systems and must be started from the command line (under Windows cmd). With:

ftp -p ftp.debian.de

the connection in passive mode would be established. On public ftp servers like this one it is possible to use anonymous as login name and an email address as password.

Sort:  

Du hast ein Upvote von mir bekommen, diese soll die Deutsche Community unterstützen. Wenn du mich unterstützten möchtest, dann sende mir eine Delegation. Egal wie klein die Unterstützung ist, Du hilfst damit der Community. DANKE!

Coin Marketplace

STEEM 0.17
TRX 0.12
JST 0.028
BTC 56420.74
ETH 2938.55
USDT 1.00
SBD 2.22