The lock command locks the current user interface to prevent unauthorized access to the device.
Usage Scenario
To prevent other users from accessing the device, you can run the lock command to lock the user interface. The user interface can be the console interface and VTY interface.
Implementation Procedure
After running the lock command, you need to enter a password twice as prompted to activate the screen save mode. When entering the same password twice, you successfully lock the current user interface. You must enter a password that meets password complexity requirements. After you run the undo user-security-policy enable command in the system view to disable the local user account security policy function, password complexity is not required when you run the lock command and set a screen saver password.
Configuration Impact
After the system is locked, if you attempt to log in to the system, press Enter and then input the correct password as prompted. In this manner, you can unlock the user interface and log in to the system.
Precautions