I currently have a Ruby (Rails) application that needs to make a lot of short SSH connections. This works fine using the Ruby Net::SSH library, except that the app has to log in and negotiate keys every time I want to make a command, which is too slow.
Is there a way to enable Control Master with Ruby Net::SSH? In testing on the command line, this makes logins (after the first one) very fast, since the connection is already open (keys are negotiated etc.).
If there is no way to do this with Net::SSH, can anybody suggest an alternative library that could do it?
I imagine this must be a common requirement, so hopefully someone can help.
Thanks!
User.ssh_connection = Net::SSH.connect(...)
) – Harry Jan 10 '12 at 13:46