in reply to Net::SSH::Perl pty problem with SSH2? SOLVED

Here's a different approach, albeit less efficient, that only uses things that seem to be working for you. I'm not in a place where I can test code, so I'm just going to sketch this out in terms of ssh commands. You are trying to connect from A to B and then from B to C:
ssh -t -l usrB machineB ssh -t -l usrC machineC uname -a
Instead, try connecting from A to B and creating a tunnel from B:2222 to C:22. Then connect from A to B:2222:
ssh -f -N -l usrB machineB -L 2222:machineC:22 ssh -t -p 2222 -l usrC machineB uname -a
A key difference here is that the main process has to start the first ssh process and then resume execution while the ssh process continues. I've never tried this from a script, so it is possible that it requires a fork. If this does work, you can reduce the added overhead by choosing weaker encryption for the tunnel's data and rely on your second connection for security.

Replies are listed 'Best First'.
Re^2: Net::SSH::Perl pty problem with SSH2?
by cmv (Chaplain) on Dec 23, 2008 at 15:38 UTC
    eye++ Thanks for the suggestion.

    This works really well when you are allowed to do it. My problem is that machine B is pretty well locked down (you can read more gory details in Populating authorized_keys with Expect) and I can't do port forwarding there.

    I'm still fiddling with various methods to solve my dilemma, and am getting close with Net::SSH::Perl. I think I'm going to dive into the code today and see if I can get SSH2 pty's working.

    -Craig