#!/usr/bin/perl use warnings; use strict; use CGI; use Net::OpenSSH; use warnings; our $cgi = new CGI; use Net::OpenSSH; my %opts = ( user => "UNAME", #password => "MYPASSWORD", strict_mode => 0, ); my $ssh = Net::OpenSSH->new("MY SERVER_IP",%opts,master_opts => [-i => "MY KEY FILE"], async => 1); $ssh->system("/root/test.sh") or die "remote command failed: " . $ssh->error;