Ssh – How to prevent theself from being automatically logged out of a cisco nexus switch because of inactivity

ciscocisco-nexusssh

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.

Best Answer

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
Related Topic