1

Net:SSH offers me two class methods:

With configuration_for() I can get the configuration from the ssh config file as a hash and with start() I can initialize a new ssh connection.

Why is or is there no overload for start(), which takes a configuration hash?

1 Answer 1

1

http://net-ssh.github.io/ssh/v2/api/classes/Net/SSH/Config.html

The page says:

Note that you will never need to use this class directly—you can control whether the OpenSSH configuration files are read by passing the :config option to Net::SSH.start. (They are, by default.)

Also take a look a the translate method:

Given a hash of OpenSSH configuration options, converts them into a hash of Net::SSH options. Unrecognized options are ignored. The settings hash must have Strings for keys, all downcased, and the returned hash will have Symbols for keys.

So, from what I read, if there's interesting stuff in the configuration files, it will be picked up by default just by calling start. Hope this helps you since I have no experience whatsoever with Net::SSH

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

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.