[PATCH] permits multiple tags on a configuration block.
kurgan kurganme
kurganme at gmail.com
Wed Jan 8 03:48:34 AEDT 2025
Hello all.
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
the following parameters can be obtained:
> gandalf at mybox $ ssh -P nocheck -P frodo-identity test-host -G |
> > grep -E "^(user|hostname|port|strictho
stkeychecking|identityfile|`
> > `userknownhostsfile|tag|proxyjump) "
> user bilbo
> hostname new-hostname
> port 12345
> stricthostkeychecking false
> identityfile ~/.ssh/id_ed25519_frodo
> userknownhostsfile /dev/null
> tag nocheck
> tag frodo-identity
> tag change-hostname
> tag change-port-and-user
> tag jump-to-mybox
> tag change-user
> proxyjump mybox
> gandalf at mybox $
Obviously, this is just an example of use, and such brief match blocks
are not useful in real cases. The example is only meant to demonstrate
the potential of the modification.
In the example, I also added multiple tags from the command line with
the `-P` option.
I believe this change is very convenient for having a sort of multiple
inheritance in configuration files.
I hope you find it interesting.
Regards
-- vincenzo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Make-it-possible-to-have-multiple-tags-on-a-configur.patch
Type: text/x-patch
Size: 4229 bytes
Desc: not available
URL: <http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20250107/9f00cce2/attachment-0001.bin>
More information about the openssh-unix-dev
mailing list