4

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

2 Answers 2

6

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).

Sign up to request clarification or add additional context in comments.

Comments

0

Just to want to add one more thing to this.

You can also use remember_host method of Net::SSH::HostKeyError to record this host and key in the known hosts file.

Example :

begin . . rescue Net::SSH::HostKeyError => e e.remember_host! retry end

Source : http://www.rubydoc.info/github/net-ssh/net-ssh/Net/SSH/HostKeyError#remember_host!-instance_method

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.