Operating System - OpenVMS
1819791 Members
3274 Online
109607 Solutions
New Discussion юеВ

Using Windows FTP in PASSIVE mode

 
SOLVED
Go to solution
Jack Trachtman
Super Advisor

Using Windows FTP in PASSIVE mode

I have a VMS host (call it "B") behind a router that doesn't allow outgoing FTP connections.

This works: I connect from VMS Host A (outside the router) to Host B via FTP, issue a SET PASSIVE ON, and then I can xfer files from A to B via a PUT cmd.

Can't get this to work: If I connect from my PC (outside the router) via XP's standard FTP to B, I can't seem to get the PASSIVE mode enabled.

I've tried: literal PASV
and: quote PASV
but no go.

Any suggestions? TIA
12 REPLIES 12
Steven Schweda
Honored Contributor

Re: Using Windows FTP in PASSIVE mode

The FTP client program and the server must
_agree_ to use passive mode. Setting the
server mode without telling the client seems
unlikely to do any good. If this is to work,
the client must have some sort of command
equivalent to "SET PASSIVE ON". Perhaps
"passive"? (And then the client should send
a suitable FTP PASV command to the server
without your having to do it manually.)
Phil.Howell
Honored Contributor

Re: Using Windows FTP in PASSIVE mode

Do you mean that "quote pasv" did not work, or that the put does not work after a "quote pasv"?
Phil
H:\>ftp
ftp> open xyz
Connected to xyz.xxxxxxxxxx.xxx.xx.
220 xyz.xxxxxxxxxx.xxx.xx. FTP Server (Version 5.1) Ready.
User (xyz.xxxxxxxxxx.xxx.xx:(none)): yyyyyy_zz
331 Username yyyyyy_zz requires a Password
Password:
230 User logged in.
ftp> quote pasv
227 Entering Passive Mode (nn,nn,nn,nnn,nnn,nnn)
ftp> bye
221 Goodbye.
Phil.Howell
Honored Contributor

Re: Using Windows FTP in PASSIVE mode

There may also be XP firewall issues.
Phil
Steven Schweda
Honored Contributor

Re: Using Windows FTP in PASSIVE mode

I could believe that "quote pasv" prepares
the server for a passive transfer, but what
tells the client to initiate a passive
transfer? And if the client's not in passive
mode, how is it supposed to move a file to or
from a server which _is_ in passive mode?

Of course, I could just be venting methane,
but I believe that the client, when in
active mode, sends a PORT command to the
server to tell the server which address and
port number to use for the transfer, while in
passive mode, the client sends the server a
PASV command, and gets back the address and
port number to use (the server's preference).

You can do all of these that you wish using
the quote command, but, when it comes time to
do a put or get (STOR or RETR), the client
will do what it thinks is appropriate.

For a good time, in the VMS-to-VMS situation,
try a transfer before and after one of those
"quote pasv" commands. I believe that you'll
see no change in what happens in the
transfer. Use the (undocumented?) "debug"
command to see more. On my system:

alp $ ftp alp-l
220- Antinode FTP Server. Please be nice.
220 alp.antinode.org FTP Server (Version 5.4) Ready.
Connected to alp.
Name (alp:sms):
331 Username sms requires a Password
Password:
230 User logged in.

FTP> debug
Debugging on (debug=1).

FTP> get a.a q.q
---> TYPE I
200 TYPE set to IMAGE.
---> PORT 10,0,0,9,210,14
200 PORT command successful.
---> RETR a.a
150 Opening data connection for ALP$DKA0:[SMS]a.a; (10.0.0.9,53774) (4 bytes)
226 Transfer complete.
local: ALP$DKA0:[SMS]Q.Q;1 remote: a.a
4 bytes received in 00:00:00.01 seconds (0.39 Kbytes/s)

[Note that the client used a PORT command to
give the server an address and port number,
as it was not in passive mode.]

FTP> quote pasv
---> pasv
227 Entering Passive Mode (10,0,0,9,210,15)

[Looks good, but does nothing useful, I
claim. Observe the next transfer.]

FTP> get a.a p.p
---> PORT 10,0,0,9,210,16
200 PORT command successful.
---> RETR a.a
150 Opening data connection for ALP$DKA0:[SMS]a.a; (10.0.0.9,53776) (4 bytes)
226 Transfer complete.
local: ALP$DKA0:[SMS]P.P;1 remote: a.a
4 bytes received in 00:00:00.01 seconds (0.33 Kbytes/s)

[Note that the client _still_ uses a PORT
command here. It's still not thinking
passive.]

FTP> passive
_ON|OFF|AUTO|ALL: on
Passive is ON.

[_Now_ the client is thinking passive ...]

FTP> get a.a s.s
---> PASV
227 Entering Passive Mode (10,0,0,9,210,17)
---> RETR a.a
150 Opening data connection for ALP$DKA0:[SMS]a.a; (10.0.0.9,53778) (4 bytes)
226 Transfer complete.
local: ALP$DKA0:[SMS]S.S;1 remote: a.a
4 bytes received in 00:00:00.01 seconds (0.30 Kbytes/s)

[... and so this transfer included a PASV
command instead of a PORT command, and the
server's response provided the address and
port number for the client to use.]

FTP> quit
---> QUIT
221 Goodbye.

(In this case, the server and client both
had the same IP address, which could be a
bit confusing, unless you just ignore that
part, in which case, it's all harmless.)

So, as I said, you need to tell the client to
use passive mode. If your client can't do
passive mode, then you'll need to get a
better client. You can't get the client into
passive mode by manually sending ("quote") a
PASV command to the server.

Google did find this guide, which might be
useful:

http://www.ncftp.com/ncftpd/doc/misc/ftp_and_firewalls.html
and
http://slacksite.com/other/ftp.html


Around here:

alp $ tcpip show version

HP TCP/IP Services for OpenVMS Alpha Version V5.4 - ECO 5
on a COMPAQ Professional Workstation XP1000 running OpenVMS V7.3-2
Wim Van den Wyngaert
Honored Contributor

Re: Using Windows FTP in PASSIVE mode

My XP ftp has no problems with it.

Try a TCP trace on VMS to see if the PASV arrived.

Wim
Wim
Steven Schweda
Honored Contributor

Re: Using Windows FTP in PASSIVE mode

> My XP ftp has no problems with it.

Is it doing passive transfers? Really? (How
do you know?)

> Try a TCP trace on VMS to see if the PASV
> arrived.

Please review:

> ftp> quote pasv
> 227 Entering Passive Mode (nn,nn,nn,nnn,nnn,nnn)

The 227 response shows that the PASV command
arrived. (But that has no effect on any
future file transfers.)

But if you know how to put the Windows XP FTP
client into passive mode, you might still
make a valuable contribution. (And if it has
a "debug" mode.)
Martin Vorlaender
Honored Contributor
Solution

Re: Using Windows FTP in PASSIVE mode

Jack,

AFAIK, the standard Win32 command line FTP client does not have the ability to use passive mode.

You'd have to use some other FTP client (e.g. FileZilla from http://filezilla.sourceforge.net/ )

cu,
Martin
Wim Van den Wyngaert
Honored Contributor

Re: Using Windows FTP in PASSIVE mode

Steven,

I used "quote pasv".

I do not know how ftp is reacting if a firewall is filtering out the PASV command (hey, it's just a program). It could be that it reacts with "unknown command" or something like that. That's why I propose a tcp trace.

As long as we don't have the exact error messages, everything is open.

Wim
Wim
Wim Van den Wyngaert
Honored Contributor

Re: Using Windows FTP in PASSIVE mode

BTW

I did get an 227.

My XP exe is in system32.

Wim
Wim
Phil.Howell
Honored Contributor

Re: Using Windows FTP in PASSIVE mode

I don't have to use passive mode, so I will leave it to others to test this client
ftp://ftp.gnu.org/old-gnu/emacs/windows/contrib/ftp-for-win32.zip
Phil
Steven Schweda
Honored Contributor

Re: Using Windows FTP in PASSIVE mode

> As long as we don't have the exact error
> messages, everything is open.

Oops. I confused a response from Mr. Howell
with more info from the original poster.

The fact remains that, at most, "quote pasv"
will tell you if the FTP server is _willing_
to do a passive transfer. It will _not_
cause the next transfer to be done
passively.
Jack Trachtman
Super Advisor

Re: Using Windows FTP in PASSIVE mode

Well, until/if I get time to trace the connection, I'll put this on hold.

Two things I've since discovered:

1) Windows FTP does seem to support Passive mode. In fact, there is a Windows Registry item for FTP "use PASV yes", so FTP seems to default to passive mode.

2) I discovered that the Internet Explorer's built-in FTP can connect to my "Host B" and both get a dir listing and xfer a file to me (though it has other problems: the dir listing doesn't show directories, and after the 1st file xfer it won't do another!)

Thanks all