1833792 Members
2259 Online
110063 Solutions
New Discussion

Re: passive ftp

 
Barbara Kramer
Frequent Advisor

passive ftp

Hi,
I need to ftp via vpn, therefore needing a passive ftp. I have written a script for normal ftp. I know ftp has a passive option, but one can only use it, once logged on to the server. I need a passive ftp, where I can log on, change dir at dest server an get and put files. I have checked out tftp, but I can not use user or change dir with tftp. Does anyone have any idea what HP has to offer for hpux 11.11?
thanks for helping
Barbara
live is great !!
12 REPLIES 12
Dennis Handly
Acclaimed Contributor

Re: passive ftp

>but one can only use it, once logged on to the server.

What's wrong with that? Just issue the command after you have logged in.
What does your current script look like?
Olivier Masse
Honored Contributor

Re: passive ftp

Have you tried using "ftp -p" ?

Barbara Kramer
Frequent Advisor

Re: passive ftp

Hi,
thanks for answering so quickly.
this is what my ftp scripts do today:

ftp -n -i -v 999.999.999.999 <
live is great !!
mobidyc
Trusted Contributor

Re: passive ftp

Hi,

from the ftp man page :
-p Enables passive mode for data transfers.

you could also use the command "passive" to enable the passive connection once you are connected.

BR,
Cedrick Gaillard
Best regards, Cedrick Gaillard
Barbara Kramer
Frequent Advisor

Re: passive ftp

Hi,
I have ajusted the ftp with the -p option. Evenso, I never heard one can use it like that, I have tried it, but unfortunately it gives error ftp: -p: unknown option
any other ideas?
live is great !!
Barbara Kramer
Frequent Advisor

Re: passive ftp

Hi,
I know, there is a command -p or passive, once logged on to the server I need to go to. Yet, the other server only allows passive ftp login. I thought of tftp, but no change of directory or sign in with user is offered with tftp ;-((
live is great !!
Dennis Handly
Acclaimed Contributor

Re: passive ftp

>unfortunately it gives error ftp: -p: unknown option

It's there on 11.23.

>But I can not even connect to the other server without passive ftp.

Hmm, I've been able to connect but quickly hang. Can you add "passive" before your first "cd"?
Barbara Kramer
Frequent Advisor

Re: passive ftp

I am working on HPUX 11.11.
I have tried:
_________________________________
ftp -n -i -v 999.999.999.999 <
live is great !!
Steven E. Protter
Exalted Contributor

Re: passive ftp

Shalom Barbara,

If you control both ends, consider openssh.

Password free it can make live much easier.

http://www.hpux.ws/?p=10

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Barbara Kramer
Frequent Advisor

Re: passive ftp

sep, thanks for answering,
I already tried to talk to the client, to use opensh. His firewall team only allows passive ftp. That is the only thing I can use. Maybe, I should install wget or pure-ftp?
Any experience with those?
live is great !!
Steven Schweda
Honored Contributor

Re: passive ftp

> [...] but one can only use it, once logged
> on to the server.

Unlike the "cd" and "mget" commands? What's
so hard about putting a "passive" command
where you need it?

> ftp: connect: Connection timed out

That's a "passive"-related problem?

Can you do a working FTP session
interactively? Might it make some sense to
try to get the basic procedure to work before
trying to create a script to automate that
procedure?

> Maybe, I should install wget or pure-ftp?

Wget can do FTP fetches. Its help ("-h")
suggests that it defaults to passive-mode
FTP:

[...]
FTP options:
[...]
--no-passive-ftp disable the "passive" transfer mode.
[...]
Steven Schweda
Honored Contributor

Re: passive ftp

> But I can not even connect to the other
> server without passive ftp.

This sounds wrong to me. Passive mode should
affect data-channel transfers, like directory
listings (dir/ls (LIST/NLST)) or file get/put
(RETR/STOR) operations. Other operations,
like user (USER, PASS), cd (CWD), and so on
should be done over the control channel, so
passive mode (or not) should not matter.

For a good time, try using "ftp -d" (or the
"debug" command) to let you see the message
traffic between your FTP client program and
the FTP server. To start, use your own FTP
server, so you have control over both ends.

Get connected, and do some work. I claim
that in non-passive mode, data-channel
transfers will involve PORT commands, and the
primary difference in passive mode will be
the replacement of those PORT commands with
PASV commands. And these will not be seen
during the login sequence, or cd actions, or
any other control-channel activity.

Now, if the troublesome FTP server is using
some non-standard port, or something like
that, then you might have some trouble
getting connected, but, as I understand FTP
(which is always open to some doubt), passive
mode (or not) should not affect the
connection+login sequence. If some odd-ball
port must be used, then I'd expect that to
affect both modes equally.