Hello,
I am trying to telnet to all m/c for which i haven't set password(only root
is a valid user)
any body can telnet using root user
But when i try to access through perl it
<snip>
use warnings;
use Net::Telnet;

my $t = new Net::Telnet (Timeout => 10,Prompt => '/bash\$ $/');
my @line;
$t->open("host1");
$t->waitfor('/login:.*$/');
$t->print("root");
$forecast=$t->print("/usr/bin/ls");
print $forecast;


O/P : 1

OR

use warnings;
use Net::Ping;
use Net::Telnet;

my $t = new Net::Telnet (Timeout => 10,Prompt => '/bash\$ $/');
my @line;
$t->open("host1");
$t->login("root","");
$result=$t->cmd("/usr/bin/ls");
print $result;

O/P : timed-out waiting for password prompt at j.pl line 8


Please, help me to understand the solution of it.
I need this as urgent requirement for house-keeping activities

Thanks in adavance

_abhi

Reply via email to