[Novalug] Speed Up Multiple SSH Connections to the Same Server
Mark Smith
mark at winksmith.com
Sun Jan 4 19:37:54 EST 2009
you don't even need to use a different configuration. just create
a host entry for a connection. when you want to connect to this
configuration, use the target in your configuration file. for
instance, i use a proxy to connect to a host behind a NAT'd firewall.
the host entry in my configuration is not even a real host name
that exists in DNS. it all just works.
for extra credit, use tab completion to complete host names and life
will be just swell.
On Sat, Jan 03, 2009 at 11:16:52AM -0500, American Dave wrote:
> I'm a big fan of connection sharing. I use it so much that I've written scripts that will only work if the control path exists. As noted in the comments in the article, you occassionaly run into issues when you wish to do something like port forwarding *after* you've established a connection. It's easy to fix this, just create a new connection with a new control path or add "-S none" to your ssh containing port forwarding.
>
> Also the article shows how to automatically enable connection sharing. To try it manually, without editing ~/.ssh/config try:
>
> ssh -M -S /tmp/test me at somehost.com
>
> Then to re-use the connection, simply type:
>
> ssh -S /tmp/test foo
>
> The second connection will be much faster, and you don't even need a valid hostname, merely the control path, "/tmp/test".
>
> Again please note that in our example, you can't "add" functionality to the original connection like port forwarding. You're merely sharing an existing connection.
--
Mark Smith
mark at winksmith.com
mark at tux.org
More information about the Novalug
mailing list