Re: How do you telnet from 1 host to another using Telnet Module
- From: John Mason Jr <notvalid@xxxxxxxxxxxxxxx>
- Date: Fri, 30 Dec 2005 14:43:31 -0500
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 .
- Follow-Ups:
- Re: How do you telnet from 1 host to another using Telnet Module
- From: mark1 . thompson45
- Re: How do you telnet from 1 host to another using Telnet Module
- References:
- How do you telnet from 1 host to another using Telnet Module
- From: mark1 . thompson45
- Re: How do you telnet from 1 host to another using Telnet Module
- From: James E Keenan
- How do you telnet from 1 host to another using Telnet Module
- Prev by Date: Re: How do you telnet from 1 host to another using Telnet Module
- Next by Date: Re: How do you telnet from 1 host to another using Telnet Module
- Previous by thread: Re: How do you telnet from 1 host to another using Telnet Module
- Next by thread: Re: How do you telnet from 1 host to another using Telnet Module
- Index(es):
Relevant Pages
|
|