use Net::SSH::Any; $Net::SSH::Any::debug = -1; my $host = 'serveraddress'; my $port = 22; my $user = 'username'; my $ppk_filepath = 'C:\Users\username\rsa-key-username'; $ssh2 = Net::SSH::Any->new($host, port => $port, user => $user, passphrase => 'passphrase123', key_path => $ppk_filepath, backends => 'Net_SSH2'); if ($ssh2->error) { die "Connection error: " . $ssh2->error; }