Skip to content

"Idle" SSH connections are forcefully disconnected #5946

@otavio

Description

@otavio

Discussed in #5945

Originally posted by zoopp March 5, 2026
I'm running into an interesting issue with my setup. I host ShellHub CE on GCP behind an External Proxy Network Load Balancer, essentially with an architecture like this:
image

The problem I keep encountering is that idle SSH connections get forcibly disconnected after a couple of minutes of inactivity:
image

This happens both when connecting through ShellHub and when using native ssh directly. Interestingly, the disconnect does not occur if there is periodic activity on the connection. For example, running something like watch <cmd> (which produces output every couple of seconds) keeps the connection alive indefinitely.

However, I expected that SSH keep alive settings might mitigate this, at least for native SSH connections. I've experimented with options like:

  • TCPKeepAlive
  • ServerAliveInterval
  • ServerAliveCountMax

... but the connection still gets dropped after a few minutes of inactivity.

Does anyone have suggestions on what could be done to prevent this, at least for native SSH connections, without changing the overall GCP setup?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions