feature addition to openssh_client: Specification of source port

Damien Miller djm at mindrot.org
Mon Oct 17 10:40:00 AEDT 2016


On Fri, 14 Oct 2016, Tanmay Tiwari wrote:

> Hello
> 
> *Feature*: Specification of local port when initiating a ssh connection
> using ssh client (and optionally specification of local address/interface)
> 
> Many people approach me for patching their openssh installation to allow
> specification of source port when using ssh client. Mostly the reason is
> they are using a source port based firewall.

Are these still a thing? Source port based filtering is pretty 1990s...

> I think it would be good to have the feature in the main branch of openssh.
> Specifying local port is a rather basic feature for a network related
> application.
> 
> I am willing to work on the feature (Its a 50 line patch anyway).

I don't think this warrants a separate option, so you'd maximise your
chances of getting it in if it was implemented as adding an optional port
to BindAddress, e.g

BindAddress *:2222
BindAddress [::]:2222
BindAddress 192.20.123.45:2222

> What are the reasons it hasn't been added yet? And should it be added to
> master?

AFAIK nobody has ever asked before.

Basing your patch off master would make it easiest to merge. Once you
have something please file a bug and attach a patch to
https://bugzilla.mindrot.org/

-d


More information about the openssh-unix-dev mailing list