For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > October 2006 > Re: Net::Telnet, wrong prompt, user not needed only password is









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Net::Telnet, wrong prompt, user not needed only password is
J. Gleixner

2006-10-30, 7:10 pm

georg.heiss@gmx.de wrote:

> $ netcat 192.168.1.254 23
> i get this prompt:
> ??????!????Fritz!Box web password:
> and after typing the password and
> # ls
> the telnet session works fine.
>
> but with perl:
> my $telnet = new Net::Telnet (Timeout => 55, Prompt => '/# /');
> $telnet->open('192.168.1.254');
> $telnet->login('root', 'passwd'); # user not needed only password is
> requested
> my @lines = $telnet->cmd("ls");
>
> i get a timeout. Any Idea???


Start with the documentation for Net::Telnet

perldoc Net::Telnet

From the documentation:

login - perform standard login
This method performs a standard login by waiting for a login prompt
[...]If any of those prompts sent by the remote
side don't match what's expected, this method will time-out, unless
timeout is turned off.
[...]
Use "dump_log()" to debug when this method keeps timing-out and you
don't think it should.

Maybe waitfor() will help.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com