Interview Prep/Linux/Networking, SSH and remote access

Your SSH sessions to a remote server drop after a few minutes idle through a corporate firewall. How do you fix it?

BeginnerScenarioNetworking, SSH and remote access
Answer

Situation read → A stateful firewall times out idle connections.

What I'd do → Client side ~/.ssh/config:

Host *
    ServerAliveInterval 60
    ServerAliveCountMax 3

Or server side: ClientAliveInterval 60.

Why → Keepalive packets keep the connection entry alive in the firewall's state table.

Interview tip → Use tmux or mosh for flaky links so your work survives drops.

All Linux questions Roadmap: Linux

More on Networking, SSH and remote access