By default, an IOS device will disconnect a console or VTY user after 10 minutes of inactivity. You can specify a different inactivity timer using the exec-timeout MINUTES SECONDS line mode command.
For example, to disconnect a console user after 90 seconds of inactivity, we can use the following command:
R1(config)#line con 0 R1(config-line)#exec-timeout 1 30
After 90 seconds of inactivity, the session will be disconnected and the user will need to supply the console password to log back in:
R1(config-line)# R1 con0 is now available Press RETURN to get started. User Access Verification Password: