Pergunta

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.

Foi útil?

Solução 2

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"]);

Outras dicas

Perhaps,

my $ssh = Net::SSH::Perl->new($server,
  debug => 1, 
  protocol => 2,
  strict_host_key_checking => "no"
) or die "Error connecting server $server";
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top