in reply to Re^2: Failed to connect the server using Net::SSH::Perl
in thread Failed to connect the server using Net::SSH::Perl

You only need to run the code I posted before once in order to populate ~/.ssh/known_hosts, after that, your script using Net::SSH::Perl would be able to connect to any host.

update: it seems that Net::SSH::Perl looks for the host keys in ~/.ssh/known_hosts2. I don't know if just copying the entries saved by your system SSH client from ~/.ssh/known_hosts to ~/.ssh/known_hosts2 will work.

  • Comment on Re^3: Failed to connect the server using Net::SSH::Perl