What's new

Prevent SSH Disconnect / Timeout around ~ 105-116 seconds from last activity on terminal session

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

rjsh

Occasional Visitor
Disconnecting SSH session when there is no activity for ~ 105-116 seconds. Want this behavior changed so it doesn't timeout for 20 minutes but not sure how or where to make a change. Am sure I am missing somethng obvious but I can't figure it out. Thx.

Rebooted the router to make sure someothing wasn't going wonky and same behavior persists.
Via the UI below are the settings I have:
- Administration > System > Basic Config > Auto Logout: 30 mins
- Administration > System > Service > Enable SSH: LAN only
- Administration > System > Service > Allow SSH Port Forwarding: NO
- Administration > System > Service > Allow Password Login: YES
- Administration > System > Service > Authorized Keys: <redacted>
- Administration > System > Service > Enable SSH Brute Force Protection: YES
- Administration > System > Service > Idle Timeout: 20 minutes
- Administration > System > Remote Access Config > Enable Web Access from WAN: NO
- Administration > System > Remote Access Config > Enable Access Restrictions: NO

From the System Messages Log (showing the connect via ssh and the auto disconnect)
Code:
Feb 27 13:44:52 RT-AC68UTM dropbear[11893]: Password auth succeeded for 'rjsh' from 192.168.1.148:51186
Feb 27 13:46:48 RT-AC68UTM dropbear[11893]: Exit (rjsh): Exited normally

Also have Skynet, Scribe, scMerlin, spdMerlin, YazDHCP installed.

FYI locally I've got my .ssh/config setup with:
Code:
TCPKeepAlive=yes
ServerAliveInterval=15
ServerAliveCountMax=6
Compression=yes

UPDATE:
When I changed config file: ServerAliveInterval=60, The connection lasts for ~ 60seconds * 6 (ServerAliveCountMax) and then disconnects (~ 360 seconds)

This older thread helped: https://www.snbforums.com/threads/dropbear-timeout.22588/
 
Last edited:
Disconnecting SSH session when there is no activity for ~ 105-116 seconds. Want this behavior changed so it doesn't timeout for 20 minutes but not sure how or where to make a change. Am sure I am missing somethng obvious but I can't figure it out. Thx.

Rebooted the router to make sure someothing wasn't going wonky and same behavior persists.
Via the UI below are the settings I have:
- Administration > System > Basic Config > Auto Logout: 30 mins
- Administration > System > Service > Enable SSH: LAN only
- Administration > System > Service > Allow SSH Port Forwarding: NO
- Administration > System > Service > Allow Password Login: YES
- Administration > System > Service > Authorized Keys: <redacted>
- Administration > System > Service > Enable SSH Brute Force Protection: YES
- Administration > System > Service > Idle Timeout: 20 minutes
- Administration > System > Remote Access Config > Enable Web Access from WAN: NO
- Administration > System > Remote Access Config > Enable Access Restrictions: NO

From the System Messages Log (showing the connect via ssh and the auto disconnect)
Code:
Feb 27 13:44:52 RT-AC68UTM dropbear[11893]: Password auth succeeded for 'rjsh' from 192.168.1.148:51186
Feb 27 13:46:48 RT-AC68UTM dropbear[11893]: Exit (rjsh): Exited normally

Also have Skynet, Scribe, scMerlin, spdMerlin, YazDHCP installed.

FYI locally I've got my .ssh/config setup with:
Code:
TCPKeepAlive=yes
ServerAliveInterval=15
ServerAliveCountMax=6
Compression=yes

UPDATE:
When I changed config file: ServerAliveInterval=60, The connection lasts for ~ 60seconds * 6 (ServerAliveCountMax) and then disconnects (~ 360 seconds)

This older thread helped: https://www.snbforums.com/threads/dropbear-timeout.22588/
Thanks - this at least will disconnect my end of the session - the router side shell is not respecting the TMOUT value any longer
 
When I changed config file: ServerAliveInterval=60, The connection lasts for ~ 60seconds * 6 (ServerAliveCountMax) and then disconnects (~ 360 seconds)
Is this on the client side (or on your router)?

I have this on the client side (macOS):

Code:
  ServerAliveInterval 60
  ServerAliveCountMax 10

This seems to work well for my Raspberry Pi's, but not for my router (GT-AX6000, running AsuswrtMerlin 388.6_2).
 
Yeah, this is client side - not router. The router file name is ssh_config or something and that file is empty and can't be edited. I think you need this option too: TCPKeepAlive=yes
 
Yeah, this is client side - not router. The router file name is ssh_config or something and that file is empty and can't be edited.
There is no ssh_config file on the router because it doesn't run an OpenSSH server. It runs dropbear with the idle timeout being "never".
 
There is no ssh_config file on the router because it doesn't run an OpenSSH server. It runs dropbear with the idle timeout being "never".
What does the "Idle timeout" field on the Admin/System page do?
It's set to 20 minutes by default, but my ssh sessions never time out.
 
My SSH sessions to the router get terminated before that 20 minute value…
 
What does the "Idle timeout" field on the Admin/System page do?
It's set to 20 minutes by default, but my ssh sessions never time out.
It's the busybox shell timeout value set in $TMOUT. That's subtlety different than an SSH server (e.g. dropbear) timeout.

However, it looks like that option has not been enabled in busybox rendering the GUI option pointless. It's enabled in John's fork but not Merlin's for some reason.

@RMerlin ?
 
Last edited:

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top