#! /usr/bin/perl
use Net::SSH2;  
my $ssh2 = Net::SSH2->new();
$ssh2->trace(-1);  
#$ssh2->connect('10.37.129.6') or die $!;
#
$ssh2->connect('193.7.160.230') or die $!;
my $aul=$ssh2->auth_list();
print $ssh2,$aul,"\n";  
$ll='scont';
$pp='tux';
my $au=$ssh2->auth_password($ll,$pp);
#auth_keyboard($ll);
print $ssh2,$au,"\n"; 
      my $chan = $ssh2->channel();
      print $chan,"\n";
      $ssh2->scp_put('pat','/tmp/pat');
      @ps=$chan->process("system",'pwd');      
      @ttls=$chan->exec("ls-l");
      print $ttls[0],$ps[0],"\n";      
      my $sftp = $ssh2->sftp();      
      my $fh = $sftp->open('/etc/passwd') or die $!;      
      print $_ while <$fh>;  

