Posted on 2008-01-10 04:06:23-08 by sameerbhasin in response to 6492
Re: Can't read from Channel filehandle.
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"; } ~ ~
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.