Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Net::SSH2 Question - again-

by idsfa (Vicar)
on May 28, 2008 at 15:27 UTC ( #688878=note: print w/ replies, xml ) Need Help??

in reply to Net::SSH2 Question - again-

You can use ssh's port forwarding to do this:

use strict; use Net::SSH2; my $ssh1 = Net::SSH2->new(); $ssh1->connect($host1) or die "connect to SSH1 failed"; $ssh1->auth_password('user', 'pass') or die "auth1 failed"; $ssh1->tcpip($host2, 22, '', 9922); my $ssh2 = Net::SSH2->new(); $ssh2->connect('', 9922) or die "connect to SSH2 failed"; $ssh2->auth_password('user2', 'pass2') or die "auth2 failed"; # ... as many hops as you need ...

The intelligent reader will judge for himself. Without examining the facts fully and fairly, there is no way of knowing whether vox populi is really vox dei, or merely vox asinorum. — Cyrus H. Gordon

Comment on Re: Net::SSH2 Question - again-
Download Code
Replies are listed 'Best First'.
Re^2: Net::SSH2 Question - again-
by bgi (Sexton) on May 29, 2008 at 15:47 UTC
    Its not working for me...after a few tests i can say, that it dont understand what to do with this line:

    $ssh2->connect('', 9922) or die "connect to SSH2 failed";
      this line is not working!! no idea why...i tested the other lines with if(-command-){print "ok";} and every line prints its "ok" expect the given line with tcpip

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://688878]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2015-10-10 07:14 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (255 votes), past polls