local-user login-period

Function

The local-user login-period command configures the period during which a local user is allowed to log in.

The undo local-user login-period command restores the default setting.

By default, the period during which a local user is allowed to log in is not configured.

Format

local-user user-name login-period begin-time to end-time begin-day to end-day

undo local-user user-name login-period

Parameters

Parameter Description Value
user-name

Specifies the user name.

The value is a string of 1 to 253 case-insensitive characters without spaces. If the value includes @, the characters before @ are the user name and the characters after @ are the domain name. If the value excludes @ or the domain name does not exist, the entire string is the user name and the user belongs to the default domain. A user name cannot contain two or more @s.

begin-time

Specifies the start time.

The value is expressed in the format of HH:MM:SS. HH:MM:SS specifies the hour, minute, and second. The value ranges from 00:00:00 to 23:59:59.

to

To the end.

-

end-time

Specifies the end time.

The value is expressed in the format of HH:MM:SS. HH:MM:SS specifies the hour, minute, and second. The value ranges from 00:00:00 to 23:59:59. End time must be later than start time.

begin-day

Specifies the start day.

The value can be Mon, Tue, Wed, Thu, Fri, Sat, and Sun.

end-day

Specifies the end day.

The value can be Mon, Tue, Wed, Thu, Fri, Sat, and Sun. End day must be later than start day.

Views

AAA view

Default Level

3: Management level

Task Name and Operations

Task Name Operations
aaa write

Usage Guidelines

Usage Scenario

To allow a local user to log in during a specified period, run the local-user login-period command.

Precautions

The local-user login-period command configures the Coordinated Universal Time (UTC) time.

After the configured period elapses, the online user is logged out.

If the local-user login-period command is run more than once, the latest configuration overrides the previous one.

A local user attribute change does not apply to online users. The change takes effect after the online users relog in.

Example

# Allow the user hellouser1 to log in from the time 8:00:00 to 18:00:00 on Monday to Saturday.
<HUAWEI> system-view
[~HUAWEI] aaa
[~HUAWEI-aaa] local-user hellouser1 password irreversible-cipher Hello-13579
[~HUAWEI-aaa] local-user hellouser1 login-period 8:00:00 to 18:00:00 Mon to Sat
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >