Configuring Time-Based User Access

The Junos OS enables you to configure time-based restrictions for user access to log in to a device. This is useful for restricting the time and duration of user logins for all users belonging to a login class. You can specify the days of the week when users can log in, the access start time, and the access end time.

[edit system]login {class class-name {allowed-days [ days-of-the-week ];access-start HH:MM;access-end HH:MM;}}

Specify the start time and end time in HH:MM (24-hour) format, where HH represents the hours and MM represents the minutes.

Note: Access start time and end time that spans across 12:00 AM on a specified day results in the user having access until the next day, even if the access day is not explicitly configured. For instance, the following configuration results in the user having access until 6:00 AM on Tuesday and Thursday, although the allowed-days statement specifies access only on Monday and Wednesday:

[edit system]login {class operator-night-shift {allowed-days [ monday wednesday ];access-start 2000;access-end 0600;}}

Related Topics