aneeshk has asked for the wisdom of the Perl Monks concerning the following question:

How can I pass 'StrictHostKeyChecking=no' and 'UserKnownHostsFile=/dev/null' in Net::SCP::Expect. I know how to use any one like below

my $scpe = Net::SCP::Expect->new( host => $ip, user => "user", passwo +rd => "password", auto_yes => 1, verbose => 0, option => 'StrictHostK +eyChecking=no' );
  • Comment on How to use -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null in Net::SCP::Expect
  • Download Code

Replies are listed 'Best First'.
Re: How to use -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null in Net::SCP::Expect
by Corion (Patriarch) on Jun 05, 2015 at 11:22 UTC

    Google tells me that this is or was a problem with openssh. Maybe this is fixed in later versions.

    Does the same work when using plain scp from the command line?

Re: How to use -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null in Net::SCP::Expect
by salva (Canon) on Jun 05, 2015 at 11:55 UTC
    Doing that is a very bad idea!

      Generally, I would agree with you however there are some scenarios where it makes sense to do so. It isn't ideal but you have to pick your battles.

      Jason L. Froebe

      Tech Blog

        You are right in that sometimes there is no alternative but to just disable host key checking entirely.

        But in my experience, it is common for people to do that without actually knowing they are ditching the protocol security, just as an easy way to get SSH working.