#!/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; #### [Fri Jun 27 12:11:57 2014] [error] [client localhost] Permission denied (publickey,gssapi-keyex,gssapi-with-mic).\r, referer: http://localhost/cgi-bin1/test.cgi