[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Reusing ssh connection in my Lua script
- From: Drake Wilson <drake@...>
- Date: Sat, 16 Oct 2010 11:42:38 -0700
Quoth Alexander Gladysh <firstname.lastname@example.org>, on 2010-10-16 22:13:46 +0400:
> Now, I've come to the point where reistablishing ssh connection for
> each command costs too much time.
> I wonder, if there is a way to safely reuse the connection?
Doing this sort of thing one has to be very careful about
synchronization and I/O buffering to avoid deadlock, and unless your
environment is very well set-up for it you can get a complexity and/or
It may be that the easiest way to handle this is externally: with
OpenSSH, at least, you can start a persistent background SSH that
keeps a ControlMaster socket open, and then each subsequent SSH
process will connect up to the original SSH connection. This is still
higher overhead than using a single SSH process, but it's better than
setting up and tearing down the remote connection every time.
---> Drake Wilson