Changing VTY Timeouts
Problem
You want to prevent your Telnet session from timing out.
Solution
To prevent Telnet (or SSH) sessions from timing out, use the following command:
Router1#configure terminalEnter configuration commands, one per line. End with CNTL/Z. Router1(config)#line vtyRouter1(config-line)#0 4exec-timeout 0 0Router1(config-line)#exitRouter1(config)#endRouter1#
You can use this same command to simply increase the EXEC timeout to a large value, such as three hours, as follows:
Router1#configure terminalEnter configuration commands, one per line. End with CNTL/Z. Router1(config)#line vtyRouter1(config-line)#0 4exec-timeoutRouter1(config-line)#240 0exitRouter1(config)#endRouter1#
Discussion
By default, the router will terminate an EXEC session after 10 minutes of inactivity. Often administrators find that 10 minute inactivity timers are a nuisance and dislike having to log in to a router several times throughout the day. So Cisco provides a way to modify or disable the inactivity timer. It is important to note that this affects only timeouts due to inactivity. In Recipe 3.11, we discuss a way to disconnect sessions after a specified length of time whether they are active or not.
The exec-timeout command has two arguments:
Router1(config-line)#exec-timeout240 0
The first argument is the length of time in minutes, and the second argument is seconds. This allows you to specify a timeout period as short as one second or as long as 35,791 minutes, which is over 24 days. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access