- #!/usr/bin/perl
- use 5.012;
- use strict;
- use warnings;
- use autodie;
- use Net::OpenSSH;
- my %param = (
- user => 'fivetrees',
- passphrase => '123456',
- key_path => '/home/fivetrees/.ssh/fivetrees',
- timeout => 10
- );
- my $ssh = Net::OpenSSH->new('192.168.1.2', %param);
- $ssh->system('echo "hello" >> xxxxx.txt');
- $ssh->scp_put('/root/a.txt', '/root/');