Skip to main content
Caution
Source Link
Chris Davies
  • 128.2k
  • 16
  • 179
  • 324

You need to identify how long it takes for an idle session to get timed out. (If you're getting timeouts across sessions that are not idle then we're chasing the wrong type of solution.)

For example, if it's one minute, then set the Keepalive to half that, i.e. 30 seconds.

I'd recommend that you don't change the default setting (Host *) but instead create a specific entry for the target host and all the possible aliases that you might use to connect to it. If you also have a default setting (Host *), where for example you set the default target username, ensure that this specific entry is listed before the default.

Host myServer myServerAlias myServer.my.domain 10.11.12.13
    ServerAliveInterval 30

It's worth taking the time to try and identify the timeout period and halving that, as blindly sending a keepalive every 30 seconds is wasteful.

You need to identify how long it takes for an idle session to get timed out. (If you're getting timeouts across sessions that are not idle then we're chasing the wrong type of solution.)

For example, if it's one minute, then set the Keepalive to half that, i.e. 30 seconds.

I'd recommend that you don't change the default setting (Host *) but instead create a specific entry for the target host and all the possible aliases that you might use to connect to it. If you also have a default setting (Host *), where for example you set the default target username, ensure that this specific entry is listed before the default.

Host myServer myServerAlias myServer.my.domain 10.11.12.13
    ServerAliveInterval 30

You need to identify how long it takes for an idle session to get timed out. (If you're getting timeouts across sessions that are not idle then we're chasing the wrong type of solution.)

For example, if it's one minute, then set the Keepalive to half that, i.e. 30 seconds.

I'd recommend that you don't change the default setting (Host *) but instead create a specific entry for the target host and all the possible aliases that you might use to connect to it. If you also have a default setting (Host *), where for example you set the default target username, ensure that this specific entry is listed before the default.

Host myServer myServerAlias myServer.my.domain 10.11.12.13
    ServerAliveInterval 30

It's worth taking the time to try and identify the timeout period and halving that, as blindly sending a keepalive every 30 seconds is wasteful.

Source Link
Chris Davies
  • 128.2k
  • 16
  • 179
  • 324

You need to identify how long it takes for an idle session to get timed out. (If you're getting timeouts across sessions that are not idle then we're chasing the wrong type of solution.)

For example, if it's one minute, then set the Keepalive to half that, i.e. 30 seconds.

I'd recommend that you don't change the default setting (Host *) but instead create a specific entry for the target host and all the possible aliases that you might use to connect to it. If you also have a default setting (Host *), where for example you set the default target username, ensure that this specific entry is listed before the default.

Host myServer myServerAlias myServer.my.domain 10.11.12.13
    ServerAliveInterval 30