Description

SSH or Telnet CLI sessions may stay on the router for extended period of time, with no idle timeout enforced:

re0> show system users
re0:
--------------------------------------------------------------------------
6:53PM up 9 days, 46 min, 3 users, load averages: 0.59, 0.63, 0.63
USER TTY FROM LOGIN@ IDLE WHAT
xyz pts/1 10.141.241.10 17:32 30:08 -cli 
xyz pts/2 10.141.241.10 18:30 1.00s -cli
xyz pts/3 10.141.241.10 16:09 1:53m -cli 


And, attempts to configure an idle timeout for any predefined class results in creation of a "local" class:

lab@RE0-MX960# set system login class super-user idle-timeout 30 permissions all 
warning: 'super-user' is a predefined class name; changing to 'super-user-local'

[edit]

Solution

Juniper defined classes:

operator
read-only
superuser or super-user
unauthorized

Do not support an idle timeout.  For example, user 'lab':

set system login user lab uid 2000
set system login user lab class super-user


When 'show cli' is run, it reports:

lab@RE0-MX960> show cli 
CLI complete-on-space set to on
CLI idle-timeout disabled
CLI restart-on-upgrade set to on
CLI screen-length set to 64
CLI screen-width set to 183
CLI terminal is 'xterm-256color'
CLI is operating in enhanced mode
CLI timestamp disabled
CLI working directory is '/var/home/lab'


However, user 'test' tied to the super-user-local group:

set system login class super-user-local idle-timeout 30
set system login class super-user-local permissions all

set system login user test uid 2005
set system login user test class super-user-local


Will have the idle timeout attached and enforced:

test@RE0-MX960> show cli 
CLI complete-on-space set to on
CLI idle-timeout set to 30 minutes
CLI restart-on-upgrade set to on
CLI screen-length set to 64
CLI screen-width set to 183
CLI terminal is 'xterm-256color'
CLI is operating in enhanced mode
CLI timestamp disabled
CLI working directory is '/var/home/test'

 

You can configure the super-user-local class to grant all permissions, and the read-only-local class with view-only permissions

 

> For super-user-local: set system login class super-user-local permissions all

> For read-only-local: set system login class read-only-local permissions view 

 

You can run the above commands to provide the corresponding permissions.

Modification History

2024-03-28 : Article Created