|
Hey Sameer Here
I have develop this and i got the output. Check this out, i hope it will get you output.
#!/usr/perl/bin -w
use Net::SSH2;
my $ssh2 = Net::SSH2->new();
$ssh2->connect('station111') or die "Unable to Connect ";
if ($ssh2->auth_password('root','access')) {
my $chan = $ssh2->channel();
$returnval=$chan->exec('pwd') or die "Message\n";
my ($len,$buff);
while($len = $chan->read($buff,1024,$strErr)){
print $buff;
}
}else{
print "Username and Password are wrong please check $!\n";
}
~
~
|