cybear has asked for the wisdom of the Perl Monks concerning the following question:

- cybear

Holders of Perl Wisdom. I have a question for you.

I am being chosen to program an application that will connect to a remote server using SSH and copy a file to my local server. As you will see we are using a Socks Proxy server. Currently that is the only authorized way to access the remote server.

Currently we use the following command to do this interactively: ssh -v -F ./ssh_proxy.cfg beng1@xxx.xxx.xxx.xxx

Can I use NET::SSH::Perl and/or Net::SFTP to go out and grab this file? Can anyone provide an example of syntax?

Replies are listed 'Best First'.
Re: SSH question - Socks Proxy
by derby (Abbot) on Jan 26, 2004 at 17:23 UTC
    The source for Net::SSH is available for viewing online here. Although not noted in the documentation, it looks like you could do something like this:

    use Net::SSH qw(ssh); push( @Net::SSH::ssh_options, "-v" ); push( @Net::SSH::ssh_options, "-F" ); push( @Net::SSH::ssh_options, "./ssh_proxy.cfg" ); ssh('beng1@xxx.xxx.xxx.xxx', $command);

    -derby