sshd -p option vs ListenAddress

Roumen Petrov openssh at roumenpetrov.info
Sat Dec 17 09:12:18 EST 2005


Chris Lightfoot wrote:
> OK, if you want a quote from the man page (sshd(8))
> 
>      -p port
>              Specifies the port on which the server listens for connections
>              (default 22).  Multiple port options are permitted.  Ports speci­
>              fied in the configuration file are ignored when a command-line
>              port is specified.
> 
> but, as stated, this is not true in the case where every
> ListenAddress line in the configuration file specifies a
> port.
> 
> 

>>Note that -p don't replace any "already-defined Port" !
> 
> 
> ?
> 
> sshd.c:981:
>                 case 'p':
>                         options.ports_from_cmdline = 1;
> 
> servconf.c:465:
>         case sPort:
>                 /* ignore ports from configfile if cmdline specifies ports */
>                 if (options->ports_from_cmdline)
>                         return 0;
> 
> 
Good catch.

- About option "Port":

Option -p realy don't replace "already-defined Port".

With .../sshd -o port=1111 -p 2222 -p 3333 -o ListenAddress=127.3.3.3
and server listen on three ports (1111, 2222 and 3333) - it's ok.

But with ../sshd -o port=1111 -p 2222 -o 'port 3333' -o ListenAddress=127.3.3.3
server will listen only on two ports (1111, 2222), but port 3333 is specified on command line too !?

What about proposed patch attached as file "openssh-20051214-cmdline_ports.patch" ?


- About option "ListenAddress":
As I understand you request is behaviour of ListenAddress to be same as Port option.
It seems to me reasonable since both options are related.

Next request is a new "short" option "-a" for ListenAddress. I don't know :-\ .

But I cannot agree with request Port or ListenAddress to replace already defined options,
since they are "multiple options" and rule is to ignore when specified.
I cann't agree with request port option to replace specified port in a ListenAddress.
They are different options.


I guess that is clear deference between a option "to be replaced" and "to be ignored when is already specified".
- "to be replaced":
    X:=a X:=b => value of X is b
- "to be ignored when is already specified"
    X:=a X:=b => value of X is a


Regards,
Roumen

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: openssh-20051214-cmdline_ports.patch
Url: http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20051217/283bc1f5/attachment.ksh 


More information about the openssh-unix-dev mailing list