NTT docomo home 5g ssh session keeps disconnecting

When using a 5G internet connection, SSH sessions can sometimes get disconnected due to inactivity. To prevent this, you can adjust the settings on both the client and server sides to keep the connection alive. Here are the steps to configure these settings:

On the SSH Client Side

  1. Modify SSH Config File:
    • Edit the SSH client configuration file, typically located at ~/.ssh/config. If the file does not exist, you can create it.
    • Add the following lines to the configuration file to enable keep-alive packets:
Host *
    ServerAliveInterval 60
    ServerAliveCountMax 5
  1. ServerAliveInterval: This setting specifies the interval (in seconds) between keep-alive messages sent to the server. Setting it to 60 seconds means the client will send a keep-alive message every 60 seconds.
  2. ServerAliveCountMax: This setting specifies the number of keep-alive messages that can be sent without receiving a response from the server before the client disconnects. Setting it to 5 means the client will wait for 5 intervals (5 minutes in this case) before disconnecting.
  3. Using Command Line Options:
    • You can also set these options directly when initiating an SSH session:
    • ssh -o ServerAliveInterval=60 -o ServerAliveCountMax=5 user@hostname
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x