~ubuntu-branches/ubuntu/trusty/libnet-openssh-perl/trusty

« back to all changes in this revision

Viewing changes to sample/password_from_data.pl

  • Committer: Package Import Robot
  • Author(s): Florian Schlichting
  • Date: 2012-02-22 23:35:55 UTC
  • Revision ID: package-import@ubuntu.com-20120222233555-j839vhem3058ewpx
Tags: upstream-0.57
ImportĀ upstreamĀ versionĀ 0.57

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
 
 
3
use strict;
 
4
use warnings;
 
5
 
 
6
use Net::OpenSSH;
 
7
 
 
8
@ARGV >= 2 or die "Usage:\n  $0 host cmd [arg1 [arg2 [...]]]\n\n";
 
9
 
 
10
my ($host, @cmd) = @ARGV;
 
11
 
 
12
my $ssh = Net::OpenSSH->new($host);
 
13
 
 
14
$ssh->system({stdin_fh => \*DATA}, sudo => -kSp => '', '--', @cmd);
 
15
 
 
16
__DATA__
 
17
my-remote-password
 
18
 
 
19