my $ssh = Net::SSH::Perl->new( $remote_host, protocol=>2, options => [ "UserKnownHostsFile /some/path/.ssh/known_hosts" ] # or "GlobalKnownHostsFile /some/path/.ssh/known_hosts" ) or die("could not connect");