ssh_config "Tag" - really only one?

Brian Candler b.candler at pobox.com
Mon Sep 14 02:58:35 AEST 2026


On 13/09/2026 16:55, Marc Haber wrote:
> On Wed, Sep 09, 2026 at 09:16:59PM +0100, Brian Candler wrote:
>> On 09/09/2026 21:11, Brian Candler wrote:
>>> That seems confusing, and I would have thought it would be better to 
>>> abort with an error message if -P is supplied more than once.
>>
>> Having said that, the current behaviour *is* internally consistent 
>> with the rest of ssh option parsing. For example, if you specify the 
>> login name multiple times, it's not rejected: first wins.
>
> But it doesnt make sense to specify multiple target hosts, user names, 
> identities.

That's correct: but they are still accepted anyway.

What I was trying to say was: given that ssh only supports a single tag, 
if the behaviour of -P xxx were to be changed to reject multiple 
invocations of -P (which would have avoided the misunderstanding you 
had), then to be consistent it ought to also reject other conflicting 
options. That's a major behaviour change and almost certainly would 
break things.

I note that settings on the command line quietly take precedence over 
settings in the config file, and settings earlier in the config file 
quietly take precedence over the same setting later in the config file. 
So I guess it's logically consistent that settings given earlier on the 
command line quietly take precedence over the same setting later on the 
command line.

Maybe a *warning* would be the right thing to do.


More information about the openssh-unix-dev mailing list