Re: How do you telnet from 1 host to another using Telnet Module



James E Keenan wrote:
mark1.thompson45@xxxxxxxxxxxxxx wrote:

Hello,
       I need to know how you telnet from one host to another using
the net::telnet module. I can telnet to a single host OK but I need to
then jump from that host o a 2nd device, I cannot get this to work, I
merely start anothet telnet session from my host machine.

I am using:-

$script = new Net::Telnet (Timeout=>5, Errmode=>'return',
Prompt=>'/[\$?>:#\]] *$/');

I call this twice but on the 2nd call I would like to jump from the
server I previously telnetted to. I need to do this as some devices I
am trying to contact can only be accessed from a jumpstart server.


First: Are you certain that the second host will accept a telnet request from the first host?

I do not have any direct experience with telnetting between two hosts,
but I recall that when I once tried to move files between two hosts
with Net::FTP, I could not do so, not because of any weakness in my
code or that module, but because the second host had restrictions
preventing me from doing so.  Perhaps the same thing would be true for
telnetting.

Jim Keenan



Turn on debugging/logging, most likely you need to modify the Prompt. At least I did when I did the same thing.


ie;

          $t->print("telnet $ip");
	  $t->waitfor('/Password:/');
	  $t->print($routerpasswd);
	  $t->waitfor($routers{$ip});


where $ip is ip address, & $routers{$ip} is the Prompt


John .



Relevant Pages

  • How do you telnet from 1 host to another using Telnet Module
    ... then jump from that host o a 2nd device, I cannot get this to work, I ... merely start anothet telnet session from my host machine. ... am trying to contact can only be accessed from a jumpstart server. ...
    (comp.lang.perl.modules)
  • Expect, telnet, frozen console.
    ... telnet into remote host, provide username/password, surrender control to ... This script will eventually be tied into /etc/inittab so that it ... app called 'loe' which presents a login screen in 80x24 ASCII a la ...
    (comp.lang.tcl)
  • Re: rlogin
    ... login the server using telnet, rsh, rlogin and also ssh. ... Telnet does not provide any protection. ... We have only 1 host system. ...
    (comp.unix.aix)
  • Re: unable to send outbound mail using outlook
    ... telnet moses.stphilipchurch.com 25 ... Connecting To moses.stphilipchurch.com...Could not open connection to the ... on port 25: Connect failed ... Connecting To 66.126.247.115...Could not open connection to the host, ...
    (microsoft.public.exchange.admin)
  • Re: No route to host
    ... route to host" is returned. ... three telnet tests to try and the results are below. ... Connection closed by foreign host. ...
    (comp.mail.sendmail)