For what it''s worth, I''ve tried
channel.exec (''command 1'')
channel.exec (''command 2'')
without success. I was in a hurry at the time and therefore my script
simply opened up another ssh connection. I''d be interested to know if
there''s a way to re-use the connection though.
-Vivek
On 12/02/07, Daniel Lorch <daniel at lorch.cc>
wrote:> Hi
>
> With OpenSSH it it possible to re-use existing sessions (see
> ControlMaster/ControlPath http://www.torchbox.com/blog/ssh_tips_2.html).
> This is nice, because it lets you establish a persistent SSH connection
> and send it to the background, so that all subsequent SSH commands to
> that host will re-use the existing session and just create new channels
> within that session.
>
> Is it possible to re-use such a session created by OpenSSH with
> Net::SSH? I think OpenSSH creates some sort of UNIX domain socket, where
> the clients connect to. If that''s not possible, is there another
> (trivial) way of keeping connections persistent with Net::SSH?
>
> Note that this is not the same as using an SSH agent, which merely
> caches the passwords.
>
> Daniel
> _______________________________________________
> Net-ssh-users mailing list
> Net-ssh-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/net-ssh-users
>