net-ssh

Need to ignore HostKeyMismatch when logging in using Net::SSH.start()


:paranoid => false in the Net::SSH.start() does not seem to work


Solution

  • You can pass a Null verifier instead of false: :paranoid => Net::SSH::Verifiers::Null.new.

    This is essentially what you should get when passing false but it doesn't appear to always work for some reason.

    Please note, just to be explicit. This does not ignore the HostKeyMismatch exception, rather it does not even attempt to verify the host key (the exception does not get raised at all).