Hi,

why are you telnetting to port 80?  That's the http port.
To use telnet, use port 23, which I think is the default anyway.

Gary

On Friday 22 June 2001  4:07 pm, Prabhu, Vrunda P (UMC-Student) wrote:
>  I too have questions on the same topic - Net::Telnet.  I tried the
> following code: (I have deleted the hostname, username and passwd), and get
> the error:
>
> read timed-out at ./teltry.cgi line 13
>
>
>
>
> #!/usr/bin/perl
>
> my ($hostname, $line, $passwd, $pop, $username);
>
> $hostname="...";
> $username="...";
> $passwd="...";
>
> use Net::Telnet ();
> $pop=new Net::Telnet (Telnetmode => 0);
> $pop->open(Host => $hostname, Port =>80);
>
> $line= $pop->getline;
> die $line unless $line=~/^\+OK/;
> $pop->print("user $username");
> $line = $pop->getline;
> die $line unless $line =~/^\+OK/;
> $pop->print("pass $passwd");
> $line=$pop->getline;
>
> Thanks in advance for any and all suggestions.  My aim is to be able to
> telnet to a site, and once there work allow the user to work at the site,
> till the time when the user might wish to telnet to another site.  If the
> second site is connected to the first, the program shoudl make an internal
> check, and allow the user to telnet there without asking for his/her
> username password again.
> I as you see in the code above am at the very early stages of attempting to
> connect to a remote site.
>
> Thanks again.
> Vrunda
>
> -----Original Message-----
> From: Tom Yarrish
> To: [EMAIL PROTECTED]
> Sent: 6/21/01 3:22 PM
> Subject: Net::Telnet
>
> Hey all,
> Okay, I'm playing with Net::Telnet, and I've gotten to the point where I
> connect to the other machine.  What I wanted to know is, can I run and
> interact with a program just using the cmd() part of that module?  Or do
> I
> need to use another module to do that.  Basically what I'm going is
> telnetting to a server, then running a program (perl scripts actually),
> then feeding it some options, and then exiting out of the program.  Sort
> of like this (snipped)
>
> $session->cmd("/home/export/user/Xmenu.pl");
> $session->cmd("2");   # This is fed to the Xmenu.pl program
> $session->cmd("1");   # and this
> $session->cmd("y");   # and this
>
> Thanks,
> Tom

-- 
Gary Stainburn
 
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000     

Reply via email to