Reputation: 167
I tried using StrictHostKeyChecking for Net::SSH::Perl as below and it didn't work.
my $ssh = Net::SSH::Perl->new("$server", debug => 1, protocol => 2, StrictHostKeyChecking => "no") or die "Error connecting server $server";
Please let me know how to make it work.
Upvotes: 0
Views: 2756
Reputation: 28693
StrictHostKeyChecking is not one of the named parameters accepted by method "new". In such cases as mentioned in the documentation of Net::SSH::Perl you can pass value for that parameter using the options parameter. Say something like below would work:
my $ssh = Net::SSH::Perl->new("$server",
debug => 1, protocol => 2,
options=> ["StrictHostKeyChecking no"]);
Upvotes: 2
Reputation: 50667
Perhaps,
my $ssh = Net::SSH::Perl->new($server,
debug => 1,
protocol => 2,
strict_host_key_checking => "no"
) or die "Error connecting server $server";
Upvotes: 3