-
Notifications
You must be signed in to change notification settings - Fork 875
Agent SSH server should use a consistent key over workspace restarts #16490
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
Labels
networking
Area: networking
Comments
This was referenced Feb 18, 2025
Closed
ThomasK33
added a commit
that referenced
this issue
Feb 21, 2025
Fixes: #16490 The Agent's SSH server now initially generates fixed host keys and, once it receives its manifest, generates and replaces that host key with the one derived from the workspace ID, ensuring consistency across agent restarts. This prevents SSH warnings and host key verification errors when connecting to workspaces through Coder Desktop. While deterministic keys might seem insecure, the underlying Wireguard tunnel already provides encryption and anti-spoofing protection at the network layer, making this approach acceptable for our use case. --- Change-Id: I8c7e3070324e5d558374fd6891eea9d48660e1e9 Signed-off-by: Thomas Kosiewski <tk@coder.com>
aslilac
pushed a commit
that referenced
this issue
Feb 21, 2025
Fixes: #16490 The Agent's SSH server now initially generates fixed host keys and, once it receives its manifest, generates and replaces that host key with the one derived from the workspace ID, ensuring consistency across agent restarts. This prevents SSH warnings and host key verification errors when connecting to workspaces through Coder Desktop. While deterministic keys might seem insecure, the underlying Wireguard tunnel already provides encryption and anti-spoofing protection at the network layer, making this approach acceptable for our use case. --- Change-Id: I8c7e3070324e5d558374fd6891eea9d48660e1e9 Signed-off-by: Thomas Kosiewski <tk@coder.com>
aslilac
pushed a commit
that referenced
this issue
Feb 27, 2025
Fixes: #16490 The Agent's SSH server now initially generates fixed host keys and, once it receives its manifest, generates and replaces that host key with the one derived from the workspace ID, ensuring consistency across agent restarts. This prevents SSH warnings and host key verification errors when connecting to workspaces through Coder Desktop. While deterministic keys might seem insecure, the underlying Wireguard tunnel already provides encryption and anti-spoofing protection at the network layer, making this approach acceptable for our use case. --- Change-Id: I8c7e3070324e5d558374fd6891eea9d48660e1e9 Signed-off-by: Thomas Kosiewski <tk@coder.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
We should enhance the agent to use the same SSH key each time the workspace is restarted, so that users of Coder VPN (#14859) can SSH into their workspaces with no extra config steps.
I think it is acceptable to just use a hardcoded SSH key, since the Wireguard protocol routes packets based on the tunnel crypto keys, so anti-spoofing of the workspace is handled at this lower layer.
Background
Today we handle end user SSH connections with the Coder CLI, either directly with the
coder ssh
command, or indirectly by instructing the SSH process to startcoder
as a proxy command. In both these circumstances, we are able to configure the SSH client to ignore the fact that our workspace SSH server uses a different key each time the workspace is restarted. This is very non-standard, and a default configured SSH client will reject reconnection to the same workspace after a restart.e.g.
If we want Coder VPN users to connect over SSH without special config, we need to use a consistent key.
The text was updated successfully, but these errors were encountered: