On 05/05/2009, at 5:51 AM, Vinay Gavankar wrote:
I get 'Invalid command' message when I do pasv. (pasv is not listed
as a
valid command when I do 'help' at the ftp prompt).
Then get a better FTP client. My guess is you are using the pathetic
client supplied with WinDOS which does not support PASV (at least not
on any release up to and including XP). Although it satisfies the
minimum implementation described in Section 5.1 of RFC 959 it fails to
satisfy the required minimum implementation as described in Section
4.1.2.13 of RFC 1123.
As Scott K. has explained on numerous occasions FTP requires two
ports: one for Control and one for Data. CD and a number of other FTP
commands send both the command and the data across the Control port
but file transfers send the data across the Data port.
Servers that correctly implement the FTP RFC will use the port
immediately adjacent to (and lower than) the control port for the
default data port. Hence, for most servers port 21 is the control port
and port 20 is the data port. However, it seems that many servers
don't do this and just grab an ephemeral port for the data port.
Clients that correctly implement the FTP RFC will use the client
control port for the default data port and compliant servers will
understand this behaviour. Clients that do this generally do not have
a problem with Firewalls** because the same port is used for control
and data. The only issue with using the default data port is the TCP
delay before reusing a closed port but a good client will handle this.
Good clients will support PORT to change the default data port. Better
(and currently compliant) clients will support PASV to inform the
server to expect an incoming data connexion.
Properly compliant clients, such as the OS/400 FTP client (at least as
far as PORT and PASV are concerned), allow you to disable PORT and
PASV which will force the default data port to be used. Most clients
either do not allow disabling or only allow PORT to be disabled.
So you need a client that will either allow the default data port to
be used or supports PASV. The WinDOS FTP client does neither.
**Note that a Firewall configured to allow outgoing connexions but
reject incoming connexions will still break the FTP default data port
because the default FTP behaviour is for the server to connect back to
the client.
Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software OS/400, i5/OS Technical Specialists
http://www.flybynight.com.au/
Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------
As an Amazon Associate we earn from qualifying purchases.