#!/usr/bin/perl use warnings; use strict; use Net::SSH2; my $ssh2 = Net::SSH2->new(); $ssh2->connect('localhost') or die "Unable to connect Host $@ \n"; $ssh2->auth_password('z','ztester') or die "Unable to login $@ \n"; #works #my $sftp = $ssh2->sftp(); #my $fh = $sftp->open('/etc/passwd') or die; #print $_ while <$fh>; # A channel object is created by the Net::SSH2 "channel" method. # As well as being an object, it is also a tied filehandle. my $chan = $ssh2->channel(); $chan->exec('ls -la'); while (<$chan>){ print }
In reply to Re: help on Net::SSH2
by zentara
in thread help on Net::SSH2
by shanthiann
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |