ftp:active_vs_passive_ftp
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
ftp:active_vs_passive_ftp [2016/12/14 10:35] – peter | ftp:active_vs_passive_ftp [2020/07/19 22:52] (current) – old revision restored (2020/07/18 10:36) 192.99.10.93 | ||
---|---|---|---|
Line 13: | Line 13: | ||
When drawn out, the connection appears as follows: | When drawn out, the connection appears as follows: | ||
- | |||
- | {{: | ||
- | |||
In step 1, the client' | In step 1, the client' | ||
Line 22: | Line 19: | ||
- | ==== Active FTP Example ==== | ||
- | |||
- | Below is an example of an active FTP session. | ||
- | |||
- | In this example an FTP session is initiated from test.sharewiz.net (192.168.1.8), | ||
- | |||
- | There are a few interesting things to consider about this dialog. | ||
- | |||
- | <code ftp> | ||
- | ftp -d test2 | ||
- | Connected to test2.sharewiz.net. | ||
- | 220 test2.sharewiz.net FTP server ready. | ||
- | Name (test2: | ||
- | ---> USER testuser | ||
- | 331 Password required for testuser. | ||
- | Password: somepassword | ||
- | ---> PASS XXXX | ||
- | 230 User testuser logged in. | ||
- | ---> SYST | ||
- | 215 UNIX Type: L8 | ||
- | Remote system type is UNIX. | ||
- | Using binary mode to transfer files. | ||
- | ftp> ls | ||
- | ftp: setsockopt (ignored): Permission denied | ||
- | ---> PORT 192, | ||
- | 200 PORT command successful. | ||
- | ---> LIST | ||
- | 150 Opening ASCII mode data connection for file list. | ||
- | drwx------ | ||
- | 226 Transfer complete. | ||
- | ftp> quit | ||
- | ---> QUIT | ||
- | 221 Goodbye. | ||
- | </ | ||
===== Passive FTP ===== | ===== Passive FTP ===== | ||
- | In order to resolve the issue of the server initiating the connection to the client a different method for FTP connections was developed. | ||
- | |||
- | In passive mode FTP the client initiates both connections to the server, solving the problem of firewalls filtering the incoming data port connection to the client from the server. | ||
- | |||
- | From the server-side firewall' | ||
- | |||
- | * FTP server' | ||
- | * FTP server' | ||
- | * FTP server' | ||
- | * FTP server' | ||
- | |||
- | When drawn, a passive mode FTP connection looks like this: | ||
- | |||
- | {{: | ||
- | |||
- | |||
- | In step 1, the client contacts the server on the command port and issues the PASV command. | ||
- | |||
- | While passive mode FTP solves many of the problems from the client side, it opens up a whole range of problems on the server side. The biggest issue is the need to allow any remote connection to high numbered ports on the server. | ||
- | |||
- | The second issue involves supporting and troubleshooting clients which do (or do not) support passive mode. As an example, the command line FTP utility provided with Solaris does not support passive mode, necessitating a third-party FTP client, such as ncftp. | ||
- | |||
- | NOTE: This is no longer the case--use the -p option with the Solaris FTP client to enable passive mode! | ||
- | |||
- | With the massive popularity of the World Wide Web, many people prefer to use their web browser as an FTP client. | ||
- | |||
- | |||
- | ==== Passive FTP Example ==== | ||
- | |||
- | Below is an actual example of a passive FTP session. | ||
- | |||
- | In this example an FTP session is initiated from test.sharewiz.net (192.168.1.8), | ||
- | |||
- | Notice the difference in the PORT command in this example as opposed to the active FTP example. | ||
- | |||
- | <code ftp> | ||
- | ftp -d test2 | ||
- | Connected to test2.sharewiz.net. | ||
- | 220 test2.sharewiz.net FTP server ready. | ||
- | Name (test2: | ||
- | ---> USER testuser | ||
- | 331 Password required for testuser. | ||
- | Password: somepassword | ||
- | ---> PASS XXXX | ||
- | 230 User testuser logged in. | ||
- | ---> SYST | ||
- | 215 UNIX Type: L8 | ||
- | Remote system type is UNIX. | ||
- | Using binary mode to transfer files. | ||
- | ftp> passive | ||
- | Passive mode on. | ||
- | ftp> ls | ||
- | ftp: setsockopt (ignored): Permission denied | ||
- | ---> PASV | ||
- | 227 Entering Passive Mode (192, | ||
- | ---> LIST | ||
- | 150 Opening ASCII mode data connection for file list | ||
- | drwx------ | ||
- | 226 Transfer complete. | ||
- | ftp> quit | ||
- | ---> QUIT | ||
- | 221 Goodbye. | ||
- | </ | ||
- | |||
- | |||
- | ===== References ===== | ||
- | |||
- | http:// |
ftp/active_vs_passive_ftp.1481711718.txt.gz · Last modified: 2020/07/15 09:30 (external edit)