The synopsis in Net::SSH2 gives an example of what you want to do.
# Shamelessly cut and paste from said synopsis;) use Net::SSH2; my $ssh2 = Net::SSH2->new(); $ssh2->connect('example.com') or die; if ($ssh2->auth_keyboard('fizban')) { my $chan = $ssh2->channel(); $chan->exec('program'); my $sftp = $ssh2->sftp(); my $fh = $sftp->open('/etc/passwd') or die; print $_ while <$fh>; }
In reply to Re: How to connect to remote machine
by hipowls
in thread How to connect to remote machine
by aalneyperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |