Feature Request: socket-passing support in ssh client

rsbecker at nexbridge.com rsbecker at nexbridge.com
Sat Jan 15 07:52:38 AEDT 2022


On January 14, 2022 12:45 PM, Chris Mitchell wrote:
> On Thu, 13 Jan 2022 18:11:20 -0500
> <rsbecker at nexbridge.com> wrote:
> 
> > For multiplexed connections, would not local port forwarding be a
> > better architecture? It does not pass off sockets but allows on-demand
> > access. --Randall
> 
> I must admit I don't really get what you're suggesting.
> 
> When you say "local port forwarding", do you mean the "ssh -L" option?
> Because if that allows the kind of on-demand access I've described, I'd be
grateful
> if you could explain how to do it.
> 
> Or do you mean some other tool to forward one or more local ports to the
one
> local port that ssh is already forwarding to the remote host? (Does that
even make
> sense?) Or something else again?
> 
> And I may have made an A/B error talking about passing off sockets.
> Passing sockets is not an objective per se, but rather in my limited
understanding I
> had assumed it was "the" way to achieve the kind of on-demand port
forwarding
> I'm after.

Yes, ssh -L address. Once you set up the forward, you can then connect a
local socket over an existing SSH session. The connection is independent of
other connections, so you don't have to worry about multiplexing. Once the
session ends, all of the forwarding ends also. You don't need to pass off
the socket, although you can use standard Linux socket passing techniques to
do that.
--Randall



More information about the openssh-unix-dev mailing list