Skip to content

[vnet] feat: automatic SSH client configuration in Connect#55924

Merged
nklaassen merged 11 commits intomasterfrom
nklaassen/vnet-ssh-autoconfig-connect
Jun 26, 2025
Merged

[vnet] feat: automatic SSH client configuration in Connect#55924
nklaassen merged 11 commits intomasterfrom
nklaassen/vnet-ssh-autoconfig-connect

Conversation

@nklaassen
Copy link
Copy Markdown
Contributor

@nklaassen nklaassen commented Jun 20, 2025

This PR adds a modal in Connect that explains the configuration necessary so that OpenSSH-compatible clients can automatically use VNet, and builds on #55923 to add a one-click button to automatically add the configuration.

The modal can be opened from three places:

  • it automatically opens when the user clicks "Connect with VNet" next to an SSH server but SSH clients are not already configured
  • VNet's connection slider, which will display a warning if SSH clients are not configured and a new [Resolve] button to open the modal
  • the VNet diagnostic page, which also displays a warning and the new [Resolve] button
Screenshots Screenshot 2025-06-24 at 2 41 00 PM Screenshot 2025-06-24 at 2 41 12 PM Screenshot 2025-06-24 at 2 41 26 PM
Screen.Recording.2025-06-24.at.2.34.55.PM.mov

@nklaassen nklaassen added no-changelog Indicates that a PR does not require a changelog entry vnet labels Jun 20, 2025
@github-actions github-actions Bot requested review from bl-nero and ravicious June 20, 2025 01:32
@nklaassen nklaassen marked this pull request as draft June 20, 2025 01:32
@nklaassen nklaassen force-pushed the nklaassen/vnet-ssh-autoconfig branch from 1ce971f to a1e3c14 Compare June 20, 2025 02:14
@nklaassen nklaassen force-pushed the nklaassen/vnet-ssh-autoconfig-connect branch from 9ccd7ba to e492de1 Compare June 20, 2025 02:14
@nklaassen nklaassen force-pushed the nklaassen/vnet-ssh-autoconfig branch 3 times, most recently from de4d430 to 5cd4600 Compare June 20, 2025 17:36
@nklaassen nklaassen force-pushed the nklaassen/vnet-ssh-autoconfig-connect branch 3 times, most recently from 307e73f to 2879241 Compare June 20, 2025 22:44
@nklaassen nklaassen marked this pull request as ready for review June 20, 2025 22:45
@github-actions github-actions Bot requested review from gzdunek and kimlisa June 20, 2025 22:46
@ravicious ravicious removed request for bl-nero and kimlisa June 24, 2025 15:59
Comment thread web/packages/teleterm/src/ui/Vnet/useVnetLauncher.tsx Outdated
Comment thread web/packages/teleterm/src/ui/Vnet/useVnetLauncher.tsx Outdated
Comment thread web/packages/teleterm/src/ui/Vnet/DocumentVnetDiagReport.tsx Outdated
@ravicious ravicious self-requested a review June 24, 2025 17:01
@nklaassen nklaassen force-pushed the nklaassen/vnet-ssh-autoconfig branch from 5cd4600 to 58246e1 Compare June 24, 2025 17:06
@nklaassen nklaassen force-pushed the nklaassen/vnet-ssh-autoconfig-connect branch from 2879241 to 6c0f4af Compare June 24, 2025 17:06
@nklaassen nklaassen force-pushed the nklaassen/vnet-ssh-autoconfig branch from 58246e1 to 3acfc10 Compare June 24, 2025 21:49
@nklaassen nklaassen force-pushed the nklaassen/vnet-ssh-autoconfig-connect branch from afe02ab to e3cdfe5 Compare June 24, 2025 21:49
Comment thread web/packages/teleterm/src/ui/Vnet/vnetContext.tsx
Comment thread web/packages/teleterm/src/ui/Vnet/vnetContext.tsx Outdated
Comment thread web/packages/teleterm/src/ui/Vnet/useVnetLauncher.tsx Outdated
);

const autoConfigureSSH = useCallback(async (): Promise<void> => {
await vnet.autoConfigureSSH({});
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, in JS we don't capitalize acronyms, so the autoConfigureSSH function we define on line 477 "should" be autoConfigureSsh.

However, we don't have control over the proto plugin generating vnet.autoConfigureSSH, so I believe it might be better to just use SSH consistently everywhere like you already do.

@ravicious
Copy link
Copy Markdown
Member

I'll give it a go tomorrow because so far I've only been looking at the code and the storybook.

@ravicious ravicious self-requested a review June 25, 2025 16:07
Copy link
Copy Markdown
Contributor

@gzdunek gzdunek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed a small spacing improvement, I'll test the PR tomorrow.

Comment thread web/packages/teleterm/src/ui/Vnet/ConfigureSSHClients.tsx
Comment thread web/packages/teleterm/src/ui/Vnet/ConfigureSSHClients.tsx Outdated
@gzdunek gzdunek self-requested a review June 25, 2025 16:34
Base automatically changed from nklaassen/vnet-ssh-autoconfig to master June 25, 2025 20:14
@nklaassen nklaassen force-pushed the nklaassen/vnet-ssh-autoconfig-connect branch from 8e65619 to 6d23b1f Compare June 25, 2025 20:49
nklaassen and others added 2 commits June 25, 2025 13:59
Co-authored-by: Grzegorz Zdunek <gzdunek@users.noreply.github.com>
Copy link
Copy Markdown
Member

@ravicious ravicious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new flow with the modal and the notification is pretty sweet and it addresses all concerns I had in #55924 (comment).

Comment thread web/packages/teleterm/src/ui/Vnet/useVnetLauncher.tsx Outdated
Comment thread web/packages/teleterm/src/ui/Vnet/useVnetLauncher.tsx Outdated
Comment thread web/packages/teleterm/src/ui/Vnet/vnetContext.tsx Outdated
Comment thread web/packages/teleterm/src/ui/Vnet/DocumentVnetDiagReport.tsx Outdated
Comment thread web/packages/teleterm/src/ui/Vnet/vnetContext.tsx
@nklaassen nklaassen enabled auto-merge June 26, 2025 21:33
@nklaassen nklaassen added this pull request to the merge queue Jun 26, 2025
Merged via the queue into master with commit 165424a Jun 26, 2025
43 checks passed
@nklaassen nklaassen deleted the nklaassen/vnet-ssh-autoconfig-connect branch June 26, 2025 22:12
nklaassen added a commit that referenced this pull request Jun 26, 2025
Backport #55924 to branch/v18

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
Co-authored-by: Grzegorz Zdunek <grzegorz.zdunek@goteleport.com>
nklaassen added a commit that referenced this pull request Jun 26, 2025
Backport #55924 to branch/v17

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
Co-authored-by: Grzegorz Zdunek <grzegorz.zdunek@goteleport.com>
github-merge-queue Bot pushed a commit that referenced this pull request Jul 22, 2025
* [v17][vnet] feat: TCP dial to SSH targets

Backport #55087 to branch/v17

* [v17][vnet] feat: accept incoming SSH connections

Backport #55155 to branch/v17

* [v17][vnet] feat: forward SSH connections to target

Backport #55156 to branch/v17

* [v17][vnet] feat: write VNet SSH keys to TELEPORT_HOME

Backport #55228 to branch/v17

* [v17][vnet] feat: write OpenSSH-compatible config file for VNet SSH

Backport #55239 to branch/v17

* [v17][vnet] fix: support <hostname>.<leaf-cluster> for VNet SSH

Backport #55688 to branch/v17

* fix BlockUntil API for backport

* [v17][vnet] feat: add "Connect with VNet" button to SSH servers

Backport #55623 to branch/v17

* [v17][vnet] feat: support VNet SSH when cluster name does not match proxy public addr

Backport #55655 to branch/v17

* [v17][vnet] feat: add SSH configuration diagnostic

Backport #55594 to branch/v17

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>

* [v17][vnet] feat: show SSH status in VNet slider

Backport #55755 to branch/v17

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>

* [v17][vnet] feat: support proxy recording mode with VNet SSH

Backport #55788 to branch/v17

* [v17][vnet] feat: support diag checks on windows

Backport #55856 to branch/v17

* [v17] fix: data race in vnet.TestSSH

Backport #55980 to branch/v17

* [v17][vnet] feat: mention SSH on VNet info page

Backport #55973 to branch/v17

* [v17][vnet] feat: serve DNS on IPv4

Backport #55539 to branch/v17

* [v17][vnet] fix: close proxied channel only after data and requests are complete

Backport #56020 to branch/v17

* [v17][vnet] feat: automatic SSH client configuration

Backport #55923 to branch/v17

* VNet docs: Provide clear instructions for getting debug logs (#56068)

* VNet diag notification: Do not show button to open report if there's no workspace selected (#56067)

* VNet diag report: Don't show button in notification if there's no workspace

* Replace deprecated MutableRefObject with RefObject

* Make openReport not depend on value of rootClusterUri

Otherwise the effect that uses setInterval re-runs whenever the user
switches to another workspace.

* [v17][vnet] feat: automatic SSH client configuration in Connect

Backport #55924 to branch/v17

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
Co-authored-by: Grzegorz Zdunek <grzegorz.zdunek@goteleport.com>

* [v17][vnet] fix: avoid empty host matchers in generated SSH config

Backport #56103 to branch/v17

* avoid t.Context() pre go1.24

* fix cspell lint

* [v17][docs] VNet SSH

Backport #56147 to branch/v17

* [v17][vnet] feat: SSH usage reporting

Backport #56537 to branch/v17

* [v17][vnet] fix: mask default IP route on windows

Backport #56957 to branch/v17

---------

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
Co-authored-by: Grzegorz Zdunek <grzegorz.zdunek@goteleport.com>
github-merge-queue Bot pushed a commit that referenced this pull request Jul 22, 2025
* [v18][vnet] feat: TCP dial to SSH targets

Backport #55087 to branch/v18

* [v18][vnet] feat: accept incoming SSH connections

Backport #55155 to branch/v18

* [v18][vnet] feat: forward SSH connections to target

Backport #55156 to branch/v18

* [v18][vnet] feat: write VNet SSH keys to TELEPORT_HOME

Backport #55228 to branch/v18

* [v18][vnet] feat: write OpenSSH-compatible config file for VNet SSH

Backport #55239 to branch/v18

* [v18][vnet] fix: support <hostname>.<leaf-cluster> for VNet SSH

Backport #55688 to branch/v18

* [v18][vnet] feat: add "Connect with VNet" button to SSH servers

Backport #55623 to branch/v18

* fix test in backport

* [v18][vnet] feat: support VNet SSH when cluster name does not match proxy public addr

Backport #55655 to branch/v18

* [v18][vnet] feat: add SSH configuration diagnostic

Backport #55594 to branch/v18

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>

* [v18][vnet] feat: show SSH status in VNet slider

Backport #55755 to branch/v18

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>

* [v18][vnet] feat: support proxy recording mode with VNet SSH

Backport #55788 to branch/v18

* [v18][vnet] feat: support diag checks on windows

Backport #55856 to branch/v18

* [v18] fix: data race in vnet.TestSSH

Backport #55980 to branch/v18

* [v18][vnet] feat: mention SSH on VNet info page

Backport #55973 to branch/v18

* [v18][vnet] feat: serve DNS on IPv4

Backport #55539 to branch/v18

* [v18][vnet] fix: close proxied channel only after data and requests are complete

Backport #56020 to branch/v18

* [v18][vnet] feat: automatic SSH client configuration

Backport #55923 to branch/v18

* VNet diag notification: Do not show button to open report if there's no workspace selected (#56067)

* VNet diag report: Don't show button in notification if there's no workspace

* Replace deprecated MutableRefObject with RefObject

* Make openReport not depend on value of rootClusterUri

Otherwise the effect that uses setInterval re-runs whenever the user
switches to another workspace.

* [v18][vnet] feat: automatic SSH client configuration in Connect

Backport #55924 to branch/v18

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
Co-authored-by: Grzegorz Zdunek <grzegorz.zdunek@goteleport.com>

* [v18][vnet] fix: avoid empty host matchers in generated SSH config

Backport #56103 to branch/v18

* [v18][docs] VNet SSH

Backport #56147 to branch/v18

* [v18][docs] add VNet warnings

Backport #56601 to branch/v18

* [v18][vnet] feat: SSH usage reporting

Backport #56537 to branch/v18

* [v18][vnet] fix: mask default IP route on windows

Backport #56957 to branch/v18

---------

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
Co-authored-by: Grzegorz Zdunek <grzegorz.zdunek@goteleport.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Indicates that a PR does not require a changelog entry size/md ui vnet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants