Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(agent): add second SSH listener on port 22 #16627

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

ThomasK33
Copy link
Member

@ThomasK33 ThomasK33 commented Feb 19, 2025

Fixes: coder/internal#377

Added an additional SSH listener on port 22, so the agent now listens on both, port one and port 22.


Change-Id: Ifd986b260f8ac317e37d65111cd4e0bd1dc38af8
Signed-off-by: Thomas Kosiewski [email protected]

Copy link
Member Author

ThomasK33 commented Feb 19, 2025

@ThomasK33 ThomasK33 marked this pull request as ready for review February 19, 2025 17:51
@ThomasK33 ThomasK33 force-pushed the thomask33/02-19-fix_tailnet_update_workspaceagentsshport_to_22 branch from 819a0fe to 959eb23 Compare February 19, 2025 18:58
@ThomasK33 ThomasK33 force-pushed the thomask33/02-19-fix_agentssh_pin_random_seed_for_rsa_key_generation branch from f744aa5 to d74cb78 Compare February 19, 2025 18:58
@ThomasK33 ThomasK33 marked this pull request as draft February 20, 2025 09:33
@ThomasK33 ThomasK33 force-pushed the thomask33/02-19-fix_agentssh_pin_random_seed_for_rsa_key_generation branch from d74cb78 to 38f9dfc Compare February 20, 2025 11:16
@ThomasK33 ThomasK33 force-pushed the thomask33/02-19-fix_tailnet_update_workspaceagentsshport_to_22 branch from 959eb23 to 7a2f8dd Compare February 20, 2025 11:16
@ThomasK33 ThomasK33 force-pushed the thomask33/02-19-fix_tailnet_update_workspaceagentsshport_to_22 branch from 7a2f8dd to 9355b33 Compare February 20, 2025 12:53
@ThomasK33 ThomasK33 force-pushed the thomask33/02-19-fix_agentssh_pin_random_seed_for_rsa_key_generation branch 2 times, most recently from cab51d9 to 9c85cde Compare February 20, 2025 16:10
@ThomasK33 ThomasK33 force-pushed the thomask33/02-19-fix_tailnet_update_workspaceagentsshport_to_22 branch 2 times, most recently from 72fddd1 to afb4ca0 Compare February 20, 2025 16:17
@ThomasK33 ThomasK33 changed the title fix(tailnet): update WorkspaceAgentSSHPort to 22 feat(agent): add an additional SSH listener on port 22 Feb 20, 2025
@ThomasK33 ThomasK33 changed the title feat(agent): add an additional SSH listener on port 22 feat(agent): add second SSH listener on port 22 Feb 20, 2025
@ThomasK33 ThomasK33 force-pushed the thomask33/02-19-fix_tailnet_update_workspaceagentsshport_to_22 branch from afb4ca0 to cca709a Compare February 20, 2025 16:41
@ThomasK33 ThomasK33 force-pushed the thomask33/02-19-fix_agentssh_pin_random_seed_for_rsa_key_generation branch from 9c85cde to 658db5a Compare February 21, 2025 10:33
@ThomasK33 ThomasK33 force-pushed the thomask33/02-19-fix_tailnet_update_workspaceagentsshport_to_22 branch 2 times, most recently from 2cb3669 to 650520d Compare February 21, 2025 12:40
@ThomasK33 ThomasK33 force-pushed the thomask33/02-19-fix_agentssh_pin_random_seed_for_rsa_key_generation branch from 658db5a to d0206e7 Compare February 21, 2025 12:40
@ThomasK33 ThomasK33 force-pushed the thomask33/02-19-fix_tailnet_update_workspaceagentsshport_to_22 branch from 650520d to 0777db7 Compare February 21, 2025 12:52
@ThomasK33 ThomasK33 force-pushed the thomask33/02-19-fix_agentssh_pin_random_seed_for_rsa_key_generation branch from d0206e7 to ad275dc Compare February 21, 2025 13:06
@ThomasK33 ThomasK33 force-pushed the thomask33/02-19-fix_tailnet_update_workspaceagentsshport_to_22 branch from 0777db7 to f674d83 Compare February 21, 2025 13:06
@ThomasK33 ThomasK33 marked this pull request as ready for review February 21, 2025 13:08
@ThomasK33 ThomasK33 changed the base branch from thomask33/02-19-fix_agentssh_pin_random_seed_for_rsa_key_generation to graphite-base/16627 February 21, 2025 13:58
@ThomasK33 ThomasK33 force-pushed the thomask33/02-19-fix_tailnet_update_workspaceagentsshport_to_22 branch from f674d83 to a2ce9b2 Compare February 21, 2025 13:58
@ThomasK33 ThomasK33 changed the base branch from graphite-base/16627 to main February 21, 2025 13:59
@ThomasK33 ThomasK33 force-pushed the thomask33/02-19-fix_tailnet_update_workspaceagentsshport_to_22 branch from a2ce9b2 to c9c1602 Compare February 21, 2025 13:59
Copy link
Member

@ethanndickson ethanndickson left a comment

Choose a reason for hiding this comment

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

In our meeting I vaguely recall talking about if we could have the ssh daemon listen on port 22 only for the tailnet interface, as to not interfere with any others running on the workspace. Is that implicit in this change?

Copy link
Contributor

@spikecurtis spikecurtis left a comment

Choose a reason for hiding this comment

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

Looks good, but needs a test.

@ThomasK33
Copy link
Member Author

In our meeting I vaguely recall talking about if we could have the ssh daemon listen on port 22 only for the tailnet interface, as to not interfere with any others running on the workspace. Is that implicit in this change?

We're explicitly doing this by using sshListener, err := network.Listen("tcp", ":"+strconv.Itoa(port)) , which in turn creates a listener only on the Tailscale network.

@ThomasK33 ThomasK33 force-pushed the thomask33/02-19-fix_tailnet_update_workspaceagentsshport_to_22 branch from c9c1602 to 07d5dc8 Compare February 27, 2025 12:52
@ThomasK33 ThomasK33 force-pushed the thomask33/02-19-fix_tailnet_update_workspaceagentsshport_to_22 branch 6 times, most recently from ae9e243 to aa1bd9d Compare February 27, 2025 16:08
@matifali
Copy link
Member

/cherry-pick release/2.20

Change-Id: Ifd986b260f8ac317e37d65111cd4e0bd1dc38af8
Signed-off-by: Thomas Kosiewski <[email protected]>
@ThomasK33 ThomasK33 force-pushed the thomask33/02-19-fix_tailnet_update_workspaceagentsshport_to_22 branch from aa1bd9d to a9dec6b Compare February 28, 2025 09:13
@ThomasK33 ThomasK33 merged commit d0e2060 into main Mar 3, 2025
31 checks passed
Copy link
Member Author

Merge activity

  • Mar 2, 10:47 PM EST: A user merged this pull request with Graphite.

@ThomasK33 ThomasK33 deleted the thomask33/02-19-fix_tailnet_update_workspaceagentsshport_to_22 branch March 3, 2025 03:47
gcp-cherry-pick-bot bot pushed a commit that referenced this pull request Mar 3, 2025
Fixes: coder/internal#377

Added an additional SSH listener on port 22, so the agent now listens on both, port one and port 22.

---
Change-Id: Ifd986b260f8ac317e37d65111cd4e0bd1dc38af8
Signed-off-by: Thomas Kosiewski <[email protected]>
@github-actions github-actions bot locked and limited conversation to collaborators Mar 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Agent SSH server should listen on port 22 over tailnet
5 participants