Skip to main content
replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
Source Link

I do not think you can get what you want using ssh settings. ClientAlive* settings are meant for when the connection between the ssh client and the ssh server become unresponsive, how long either side should wait (these are obviously the client's timeouts).

Rather I'd use Bash's $TMOUT environment variable to get the shell to disconnect after a set period of time.

TMOUT  If  set  to  a  value greater than zero, TMOUT is treated as the 
       default timeout for the read builtin.  The select command terminates 
       if input does not arrive after TMOUT seconds when input is  coming  
       from  a  terminal.   In  an interactive  shell,  the value is 
       interpreted as the number of seconds to wait for input after issuing 
       the primary prompt.  Bash terminates after waiting for that number of 
       seconds if input does not arrive.

References

I do not think you can get what you want using ssh settings. ClientAlive* settings are meant for when the connection between the ssh client and the ssh server become unresponsive, how long either side should wait (these are obviously the client's timeouts).

Rather I'd use Bash's $TMOUT environment variable to get the shell to disconnect after a set period of time.

TMOUT  If  set  to  a  value greater than zero, TMOUT is treated as the 
       default timeout for the read builtin.  The select command terminates 
       if input does not arrive after TMOUT seconds when input is  coming  
       from  a  terminal.   In  an interactive  shell,  the value is 
       interpreted as the number of seconds to wait for input after issuing 
       the primary prompt.  Bash terminates after waiting for that number of 
       seconds if input does not arrive.

References

I do not think you can get what you want using ssh settings. ClientAlive* settings are meant for when the connection between the ssh client and the ssh server become unresponsive, how long either side should wait (these are obviously the client's timeouts).

Rather I'd use Bash's $TMOUT environment variable to get the shell to disconnect after a set period of time.

TMOUT  If  set  to  a  value greater than zero, TMOUT is treated as the 
       default timeout for the read builtin.  The select command terminates 
       if input does not arrive after TMOUT seconds when input is  coming  
       from  a  terminal.   In  an interactive  shell,  the value is 
       interpreted as the number of seconds to wait for input after issuing 
       the primary prompt.  Bash terminates after waiting for that number of 
       seconds if input does not arrive.

References

Source Link
slm
  • 379.7k
  • 127
  • 793
  • 897

I do not think you can get what you want using ssh settings. ClientAlive* settings are meant for when the connection between the ssh client and the ssh server become unresponsive, how long either side should wait (these are obviously the client's timeouts).

Rather I'd use Bash's $TMOUT environment variable to get the shell to disconnect after a set period of time.

TMOUT  If  set  to  a  value greater than zero, TMOUT is treated as the 
       default timeout for the read builtin.  The select command terminates 
       if input does not arrive after TMOUT seconds when input is  coming  
       from  a  terminal.   In  an interactive  shell,  the value is 
       interpreted as the number of seconds to wait for input after issuing 
       the primary prompt.  Bash terminates after waiting for that number of 
       seconds if input does not arrive.

References