Skip to content

Support wildcard/pattern matching for Host blocks (like OpenSSH Host patterns) #98

Description

@stani0502

It would be great if omnyssh could support wildcard patterns in Host entries, similar to how OpenSSH's ~/.ssh/config handles glob-style matching (*, ?) — allowing a single block to define shared defaults (e.g., IdentityFile, User) for a group of hosts, while still letting individual hosts override specific settings like Port.

Example use case:

Host app-web-prod*
  HostName 192.0.2.10
  User deployuser
  IdentityFile ~/.ssh/id_ed25519

Host app-web-prod-01
  Port 22

Host app-api-prod-01
  Port 15000

In this pattern:

  • app-web-prod* matches any host starting with app-web-prod and applies shared HostName/User/IdentityFile defaults
  • Specific host blocks (e.g., app-web-prod-01) can still override or add settings like a custom Port, following the same "first match wins per-option" merge behavior OpenSSH uses

This would reduce config duplication significantly when managing many similarly-configured hosts (e.g., a fleet of VMs with the same key/user but different ports or subtle overrides per host).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions