[PR #14042] Dynamically generate profiles from hosts in OpenSSH config files #29900

Open
opened 2026-01-31 09:37:30 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/14042

State: closed
Merged: Yes


This PR adds a new dynamic profile generator which creates profiles to
quickly connect to detected SSH hosts.

This PR adds a new SshHostGenerator inbox dynamic profile generator.
When run, it looks for an install of our
Win32-OpenSSH client app
ssh.exe in all of the (official) places it gets installed. If the exe
is found, the generator then looks for and parses both the user and
system OpenSSH config files for valid SSH hosts. Each host is then
converted into a profiles to call ssh.exe and connect to those hosts.

VALIDATION
Installed OpenSSH, configured host for alt.org NetHack server, connected
and played some NetHack from the created profile.

  • When OpenSSH is not installed, don't add profiles
  • Detected when installed via Optional Features (installs in
    System32\OpenSSH, added to PATH)
  • Detected when installed via the 32-Bit OpenSSH MSI from GitHub
    (installs in Program Files (x86)\OpenSSH, not added to PATH)
  • Detected when installed via the 64-Bit OpenSSH MSI from GitHub
    (installs in Program Files\OpenSSH, not added to PATH)
  • Detected when installed via winget install Microsoft.OpenSSH.Beta (uses MSI from GitHub)
  • With "disabledProfileSources": ["Windows.Terminal.SSH"] the
    profiles are not generated

Closes #9031

**Original Pull Request:** https://github.com/microsoft/terminal/pull/14042 **State:** closed **Merged:** Yes --- This PR adds a new dynamic profile generator which creates profiles to quickly connect to detected SSH hosts. This PR adds a new `SshHostGenerator` inbox dynamic profile generator. When run, it looks for an install of our [Win32-OpenSSH](https://github.com/PowerShell/Win32-OpenSSH) client app `ssh.exe` in all of the (official) places it gets installed. If the exe is found, the generator then looks for and parses both the user and system OpenSSH config files for valid SSH hosts. Each host is then converted into a profiles to call `ssh.exe` and connect to those hosts. VALIDATION Installed OpenSSH, configured host for alt.org NetHack server, connected and played some NetHack from the created profile. * [x] When OpenSSH is not installed, don't add profiles * [x] Detected when installed via Optional Features (installs in `System32\OpenSSH`, added to PATH) * [x] Detected when installed via the 32-Bit OpenSSH MSI from GitHub (installs in `Program Files (x86)\OpenSSH`, not added to PATH) * [x] Detected when installed via the 64-Bit OpenSSH MSI from GitHub (installs in `Program Files\OpenSSH`, not added to PATH) * [x] Detected when installed via `winget install Microsoft.OpenSSH.Beta` (uses MSI from GitHub) * [x] With `"disabledProfileSources": ["Windows.Terminal.SSH"]` the profiles are not generated Closes #9031
claunia added the pull-request label 2026-01-31 09:37:30 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#29900