0

Is there a way where I can prevent myself from being logged out of a cisco nexus switch/router (or any other cisco device) after a period of inactivity?

I get this message after being kicked off:

Inactive timeout reached, logging out.

I have the following in ~/.ssh/config (have tried specifying via command line flag as well:

Host *
  ServerAliveInterval 120

Which does not seem to do the trick as I am still logged out after 10-15 mins. If there is a way to do this, I would need to it via something on the client-side, not in the cisco configuration.

lacrosse1991
  • 1,437
  • 5
  • 20
  • 26
  • The switch's inactivity timer only cares about keystrokes... that's why `ServerAliveInterval` doesn't help. In principle, you could build some kind of [`expect`](http://linux.die.net/man/1/expect) wrapper for your ssh sessions. That script needs to be smart enough to send a space / backspace every minute or so... I'm too lazy to write that myself, but I freely license the idea to whoever answers with a working script. – Mike Pennington Oct 23 '14 at 20:13
  • SecureCRT and PuTTy both support this type of client-side config. In PuTTy it's under the 'Connection' configuration heading. Obviously not Linux related, but similar enough to note for future reference. – cpt_fink Oct 24 '14 at 01:08

1 Answers1

2

You can set exec-timeout on the line you are using to configure it. The timeout is in minutes and 0 means no timeout.

Example:

switch# configure terminal
switch(config)# line vty
switch(config-line)# exec-timeout 0
gparent
  • 3,601
  • 2
  • 24
  • 28
  • yes that would work although it would require that I change the config on the switch. Was just wondering if there was anything that I could on the client side to prevent my connection from timing out – lacrosse1991 Oct 23 '14 at 19:58
  • Any solution that involves actually using the connection would prevent it from timing out, since you're hitting the inactivity timer. – gparent Oct 23 '14 at 20:40