From sshd(8): Multiple ListenAddress options are permitted. Additionally, any Port options must precede this option for non port qualified addresses.
Looking at this since I have been poking around in this code recently. Isn't this the other way around? ie ListenAddress depends on Port? What's the desired behaviour? Use whatever Port was last specified for each ListenAddress where the port is not specified? ie Port 123 ListenAddress 192.168.0.1 Port 345 ListenAddress 192.168.0.2 ends up listening on 192.168.0.1:123 and 192.168.0.2:345 ?
IMO the behaviour I'd expect from: Port 123 ListenAddress 192.168.0.1 Port 345 ListenAddress 192.168.0.2 is listening on 192.168.0.1:123 192.168.0.1:345 192.168.0.2:123 192.168.0.2:345 regardless of the ordering of directives. We could do this by recording the listen addresses with port=0 and then expanding it with the full set of recorded ports later. Darren just pointed out that we do this wrong wrt ListenAddress too
(In reply to Damien Miller from comment #2) > Darren just pointed out that we do this wrong wrt ListenAddress too I think you meant AddressFamily.
I subscribed to this entry, but I can't recall the reason. Thus, I unsubscribe. If Markus no longer thinks this as a problem, please close this entry.
Created attachment 2609 [details] sshd: Allow ListenAddress, Port, AddressFamily in any order
Patch has been applied and will be in 6.9. Thanks.
Just a minor note: The release notes for 6.9 seem to wrongly place that change into ssh(1) instead of sshd. btw: I'd have considered to behaviour described by Damien in comment #2 to be the best solution. Cause right now, we cannot have one sshd listen to different ports on different addresses, right? :-(
taking the 2nd paragraph back... I forgot that one can give the port to ListenAddress ;-)
closing resolved bugs as of 8.6p1 release