Net-SSH2 - Re: Can't read from Channel filehandle.

Posted on Thu Jan 10 06:06:23 2008 by sameerbhasin in response to 6492 (See the whole thread of 3)
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"; } ~ ~
Write a response