Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

SSH2 with SOCKS5 proxy

by lightbringer (Novice)
on Jul 13, 2012 at 04:48 UTC ( #981555=perlquestion: print w/replies, xml ) Need Help??
lightbringer has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I have successfully established SSH2 connection by using Perl. Now I would like to connect through a SOCKS5 proxy. And when I look at the manual of Net::SSH2, it seems to have no support to create such connection. Anyone knows how to do that? I have looked at NET::Perl::SSH but they say it was too old and hasn't been updated for a long time. Thanks in advance.

Replies are listed 'Best First'.
Re: SSH2 with SOCKS5 proxy
by salva (Abbot) on Jul 13, 2012 at 06:30 UTC
    You can pass an open socket to Net::SSH2 connect instead of the host/port pair.

    So you can create the socket, connect to the proxy and do the SOCKS5 handshake yourself and then call $ssh->connect($socket).

    If you are on Linux/Unix you could even use an external program as socat to do the handshaking for you.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://981555]
Approved by kcott
[Your Mother]: Don't think so.
[Your Mother]: Windows doesn't even recognize them as far as that goes.
[Lady_Aleena]: Your Mother, thanks. I had a feeling it would be no.
[Your Mother]: :P
[Lady_Aleena]: Your Mother, it is a good thing I am no on Windows.
[Lady_Aleena]: s/no/not/;
[Lady_Aleena]: My blasted web host will not put perl 5.22 in /usr/bin/perl, it is in /usr/local/cpanel/ 3rdparty/bin/perl
Lady_Aleena has been banging her head against this wall for years now with no success on breaking the wall.

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2017-04-28 06:29 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (519 votes). Check out past polls.