#!D:\SupportTools\perl\perl\bin\perl -w use strict; use Net::SSH2; use MIME::Base64; my $ssh2 = Net::SSH2->new(); $ssh2->connect("servername") or die "Unable to connect host $@ \n"; $ssh2->auth_password('user','passwd'); my $chan = $ssh2->channel(); $chan->blocking(); $chan->exec('ls'); my $buflen = 10000; my $buf1 = '0' x $buflen; $chan->read($buf1, $buflen); #print "BUF1:\n", $buf1,"\n"; $chan->exec('exit'); $ssh2->disconnect();