[PATCH] permits multiple tags on a configuration block.
David Jack Wange Olrik
david at olrik.dk
Tue Feb 10 21:03:58 AEDT 2026
On Tue, Jan 7, 2025, at 18:26, Brian Candler wrote:
>> I wrote this small patch that allows having multiple tags on a
>> configuration block in the openssh client configuration.
>> For instance, with this configuration:
>>
>>> Host test-host
>>> Tag change-hostname change-port-and-user
>>> Tag jump-to-mybox
>>>
>>> Match tagged change-hostname
>>> Hostname new-hostname
>>>
>>> Match tagged change-port-and-user
>>> Port 12345
>>> Tag change-user
>>>
>>> Match tagged change-user
>>> User bilbo
>>>
>>> Match tagged jump-to-mybox
>>> ProxyJump mybox
>>>
>>> Match tagged nocheck
>>> StrictHostKeyChecking false
>>> UserKnownHostsFile /dev/null
>>>
>>> Match tagged frodo-identity
>>> IdentityFile ~/.ssh/id_ed25519_frodo
>
> Could this not be done using the "Include" directive? ssh_config(5) says:
>
> "Files without absolute paths are assumed to be in ~/.ssh if included in
> a user configuration file [...] Include directive may appear inside a
> Match or Host block to perform conditional inclusion."
This works for the for the static usecase in the config, but not for the dynamic
usecase on the command line using `-P <tag>`
Doing `ssh -P tag1 -P tag2 my-host.tld` could be quite useful in my opinion.
--
Best regards,
David Jack Wange Olrik <david at olrik.dk>
More information about the openssh-unix-dev
mailing list