You should be able to use the following for SSH, telnet, and console:
console(config)# line console
console(config-line)# exec-timeout 0
Specify either the number of minutes (up to 65535, equivalent to 45 days), or use zero (0) for no timeout.
It seems counter-intuitive, but using the "no" command below will timeout with the default timing.
console(config-line)# no exec-timeout
If the "zero" command doesn't work, try setting it to the maximum minutes or anything beyond a couple of hours and see if that also times out too soon.
I also set the exec-timeout to 65535 to see if that had any effect.
switch(config)# line ssh
switch(config-line)# exec-timeout 65535
switch(config-line)# exit
switch(config)# exit
switch# show clock
18:32:47 EDT(UTC-4) Jun 26 2018
Time source is sntp
switch# packet_write_wait: Connection to 192.168.2.X: Broken pipe
Tue Jun 26 19:32:48 EDT 2018
It did not have any effect; I was still logged out of the switch after 1 hour. As an experiment, I changed it to 2 minutes and I was indeed logged out after 2 minutes, but the connection was closed in a different manner. See the close statement at the bottom? It is different from the one above.
switch(config)# line ssh
switch(config-line)# exec-timeout 2
switch(config-line)# exit
switch(config)# exit
switch# show clock
20:26:33 EDT(UTC-4) Jun 26 2018
Time source is sntp
switch# Connection to switch closed.
Tue Jun 26 20:28:33 EDT 2018
versus the other close message:
switch# packet_write_wait: Connection to 192.168.2.X: Broken pipe
And, just to make sure, I set my SSH session to have the KeepAlive value to "yes", but was still logged out after an hour.
switch(config)# line ssh
switch(config-line)# exec-timeout 59
switch# show clock
22:50:47 EDT(UTC-4) Jun 26 2018
Time source is sntp
switch# Connection to switch closed.
Tue Jun 26 23:49:47 EDT 2018 timed out after 59 minutes. Expected behavior.
switch(config-line)# exec-timeout 60
switch# show clock
23:58:58 EDT(UTC-4) Jun 26 2018
Time source is sntp
switch# Connection to switch closed.
Wed Jun 27 00:58:59 EDT 2018 timed out after 60 minutes. This is unexpected.
switch1(config-line)# exec-timeout 61
switch1# show clock
13:42:12 EDT(UTC-4) Jun 27 2018
Time source is sntp
Connection to switch1 closed.
Wed Jun 27 14:43:12 EDT 2018 timed out after 61 minutes. This is
unexpected. Why didn't it disconnect after 60 minutes?
switch(config-line)# exec-timeout 62
switch# show clock
14:51:50 EDT(UTC-4) Jun 27 2018
Time source is sntp
switch# packet_write_wait: Connection to 192.168.2.X: Broken pipe
Wed Jun 27 15:51:50 EDT 2018 disconnected after 60 minutes.
Same as if exec-timeout were set to zero
Thank you for the information. Based on your feedback I did more research and found that I did not set the KeepAlive parameter properly in my SSH config file. I changed ~/.ssh/config (Linux host) to:
Host switch
ServerAliveInterval 60
and that worked. I am no longer logged out of the switch unless I explicitly close the connection. Thank you again for your help.
vt1012
212 Posts
1
June 20th, 2018 09:00
Hi Joel,
You should be able to use the following for SSH, telnet, and console:
console(config)# line console
console(config-line)# exec-timeout 0
Specify either the number of minutes (up to 65535, equivalent to 45 days), or use zero (0) for no timeout.
It seems counter-intuitive, but using the "no" command below will timeout with the default timing.
console(config-line)# no exec-timeout
If the "zero" command doesn't work, try setting it to the maximum minutes or anything beyond a couple of hours and see if that also times out too soon.
Hope this helps.
Joel_McClung
13 Posts
0
June 21st, 2018 19:00
Joel_McClung
13 Posts
0
June 26th, 2018 17:00
I also set the exec-timeout to 65535 to see if that had any effect.
It did not have any effect; I was still logged out of the switch after 1 hour. As an experiment, I changed it to 2 minutes and I was indeed logged out after 2 minutes, but the connection was closed in a different manner. See the close statement at the bottom? It is different from the one above.
versus the other close message: And, just to make sure, I set my SSH session to have the KeepAlive value to "yes", but was still logged out after an hour.Joel_McClung
13 Posts
0
June 27th, 2018 14:00
Joel_McClung
13 Posts
0
July 20th, 2018 15:00
Thank you for the information. Based on your feedback I did more research and found that I did not set the KeepAlive parameter properly in my SSH config file. I changed ~/.ssh/config (Linux host) to:
Host switch ServerAliveInterval 60and that worked. I am no longer logged out of the switch unless I explicitly close the connection. Thank you again for your help.