Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Passing telnet commands through SSH

by SiliconeClone (Initiate)
on Apr 03, 2014 at 00:50 UTC ( [id://1080868]=note: print w/replies, xml ) Need Help??


in reply to Re: Passing telnet commands through SSH
in thread Passing telnet commands through SSH

Ok this worked! However, I need it to work programatically. So i attempted to integrate the tunnel into the program.

It opens fine, I can be on the sshHost machine and see the tunnel up and running. However the program itself locks at that point. Sadness, right?

I can not figure out why it is locking. I have a sub that opens the tunnel, and then after that it should run the telnet sub (which works if I open the tunnel manually). At that point it just hangs. Any more suggestions?

It is hanging at the following

channel 1: open confirm rwindow 0 rmax 32768

This only happens when I open the tunnel. If I send other commands like "who", etc.. it does not hang at all.

Replies are listed 'Best First'.
Re^3: Passing telnet commands through SSH
by graff (Chancellor) on Apr 03, 2014 at 01:58 UTC
    I'm totally just guessing here - no real experience in this arena - but you might try running tunnel connection as a child process (or maybe the parent spawns a child to run telnet, and then the parent opens the tunnel? I'm clueless on that).

    Anyway it sounds like the program hangs because it's waiting for i/o on one connection, and so cannot do anything on the other. In my limited experience using SSH tunnels (interactively only, never via scripts), the tunnel ssh connection is always running separately (e.g. in another shell) from whatever process is supposed to actually do stuff using the tunnel.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-25 10:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found