Skip to content

SSH connection seems to remain active after being disconnected from agent #2130

Closed as not planned
@mafredri

Description

@mafredri

When using SSH (ssh coder.workspace), the connection remains active after being disconnected from agent.

Steps to reproduce:

  1. coder create workspace
  2. ssh coder.workspace
  3. coder delete workspace (or stop, start)

After step 3, the SSH command remains running until user input. After the switch to Tailscale networking, this applies for both ssh using ProxyCommand and coder ssh. (Also applies to other commands using SSH, like sftp.)

Typically when an SSH server goes away, the client is notified and we see something like:

Connection to [host] closed by remote host.
Connection to [host] closed.

Ideally we would also detect this client-side by checking workspace status from the coder API, if we're trying to connect to an outdated agent (i.e. workspace state changed after connection), we should either:

  1. Disconnect and exit
  2. Reconnect with a "Reconnected, but previous state was lost" (this is not a good message, just to illustrate)

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiArea: HTTP APIcliArea: CLIsiteArea: frontend dashboardstaleThis issue is like stale bread.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions