Skip to content

Connection doesn't work after workspace restart #427

Open
@dimm0

Description

@dimm0

Opening VSCode from coder works on the first load. If the workspace restarts, the host ssh key changes, and connection doesn't work anymore with the error:

[13:30:19.033] stderr> debug1: Server host key: ssh-rsa SHA256:Q7o4526ZRT7PXLhauYV2lr6TgfJyD+ll1uk7HlVI03M
[13:30:19.034] stderr> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[13:30:19.034] stderr> @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
[13:30:19.034] stderr> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[13:30:19.034] stderr> IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
[13:30:19.034] stderr> Someone could be eavesdropping on you right now (man-in-the-middle attack)!
[13:30:19.034] stderr> It is also possible that a host key has just been changed.
[13:30:19.034] stderr> The fingerprint for the RSA key sent by the remote host is
[13:30:19.034] stderr> SHA256:Q7o4526ZRT7PXLhauYV2lr6TgfJyD+ll1uk7HlVI03M.
[13:30:19.034] stderr> Please contact your system administrator.

Manually deleting the existing host key from ssh known_hosts fixes this and makes it work again until the next restart.

Latest version of coder and all below.

Activity

added theissue type on Feb 5, 2025
ethanndickson

ethanndickson commented on May 1, 2025

@ethanndickson
Member

This is strange, as the SSH config the VS Code extension generates sets:

StrictHostKeyChecking no

Can you double check that's the case in your SSH config? The default location is ~/.ssh/config, and you're looking for the block starting with:

# --- START CODER VSCODE coder.example.com ---

In any case, we recently made the host key of Coder workspaces deterministic, seeded by the workspace owner username, and the name of the workspace (coder/coder#16626 coder/coder#17258). That means this will stop happening, even with strict host key checking enabled.

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

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @dimm0@matifali@ethanndickson

        Issue actions

          Connection doesn't work after workspace restart · Issue #427 · coder/vscode-coder