Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

proxy - Controlling a connection to two remote systems

&pagelevel(4)&pagelevel

The proxy command controls a connection to two remote systems for transferring files between these two remote systems. A requirement here is that the second remote system supports the PASV or EPSV command.

proxy

<ftp-command>


<ftp-command>

Specifies an FTP client command:

  • In order to establish the control connection to the second system, the first <ftp-command> must be the open command.

  • When you enter proxy help the other FTP commands are shown which can be executed on the secondary connection.

The following commands behave differently if they are prefixed with proxy:

  • get and mget transfer files from the first server to the second server.

  • put, mput and append transfer files from the second server to the first server.

The figure below sketches the basic procedure for transferring a file <file> between two remote servers A and B. C is the client.

Server A Server B

C      A: connect (open)


C     B: connect (proxy open)
Processing the specified proxy get <file>:

C     B: PASV

B    C:  227 Entering Passive Mode (a1, a2, a3, a4, p1, p2)

C     A:  PORT a1, a2, a3, a4, p1, p2

A    C: 200 PORT command successful

C     A:  RETR <file>



C     B: STOR <file>


A    B: Connect to Server B (a1,a2,a3,a4), Port(p1,p2)

Figure 3: Transferring a file <file> between two remote servers


Example

All files of the ID userid1 on the remote system1 are to be transferred to the ID userid2 on the remote system2.

ftp> open system1        Open control connection to 1st server
userid1                  .
.                        .
.                        .
.                        .
ftp> proxy open system2 Open control connection to 2nd server
userid2                  .
.                        .
.                        .
.                        .
ftp> proxy?              Which proxy commands are supported?
ftp> proxy mget *        Transfer filessystem1 -> system2
ftp> proxy ls            Check result
ftp> proxy close         Close secondary control connection


The status command returns the following output in this case:

ftp> status
Connected to PGAB0021, port21.
Connected for proxy commands to system2.
Passive Mode: off
...