Configure SFTP client to use web/internet prox

I am writing a shell script which needs to connect to a remote internet ftp site over sftp. The problem is that the Red Hat Linux system on which the script will be executed resides behind a web/internet proxy. How can the standard sftp client which is bundled with Red Hat Linux distributions be configured to use an internet proxy (host, port, user, password)?

According to the sftp man page on my Slackware box you should be able to user the -o ProxyCommand option. It then references the ssh_config(5) man page for specifics. Here is the excerpt for the ProxyCommand option:

ProxyCommand
             Specifies the command to use to connect to the server.  The com-
             mand string extends to the end of the line, and is executed with
             the user's shell.  In the command string, '%h' will be substi-
             tuted by the host name to connect and '%p' by the port.  The com-
             mand can be basically anything, and should read from its standard
             input and write to its standard output.  It should eventually
             connect an sshd(8) server running on some machine, or execute
             sshd -i somewhere.  Host key management will be done using the
             HostName of the host being connected (defaulting to the name
             typed by the user).  Setting the command to ``none'' disables
             this option entirely.  Note that CheckHostIP is not available for
             connects with a proxy command.

             This directive is useful in conjunction with nc(1) and its proxy
             support.  For example, the following directive would connect via
             an HTTP proxy at 192.0.2.0:

                ProxyCommand /usr/bin/nc -X connect -x 192.0.2.0:8080 %h %p

Hopefully this will at least get you pointed in the right direction.

you can use the IP tunnling.
BR