Locking Configuration Access:
You want to prevent multiple concurrent users from making configuration changes at the same time.
To automatically prevent other users from making configuration changes at the same time as you, use the following command:
To enable the ability to lock the configuration file, on an as-needed basis, use the following command:
By default, the router running IOS software allows multiple concurrent users to change the running configuration files at once. In some operating environments, preventing multiple concurrent users from making changes is beneficial. Being able to prevent two users attempting to modify the same portion of the configuration file is desired. By enabling this feature, you temporarily prevent multiple users from modifying the router configuration at the same time.
Essentially, this feature allows only a single user to enter the configuration mode at a time. All other users on the router are effectively locked out of the configuration mode until the first user exits it. As we’ve seen in our examples, this feature runs in two modes, auto and manual. In auto mode, the configuration mode is automatically locked each time a user enters the configuration mode. In manual mode, users have the ability to manually lock the configuration mode each time they change the router configuration by using the lock keyword:
If you don’t issue the lock keyword, then the router will not lock the configuration mode and the router will function as normal. In auto mode, you don’t need to issue the lock keyword, since it is implicitly enabled.
If you attempt to enter the configuration mode and someone has already locked it, then you will receive the following message informing you that the configuration mode is locked and by whom:
You can always show the status of the configuration lock by issuing the following command:
If you absolutely need to change the router configuration and someone has locked you out, then you always have the option of terminating his or her session. Notice that user ijbrown has currently locked the configuration mode, and he is using TTY 162. In the next example, we will clear the TTY session and view the status of the configuration lock:
Notice that once we clear the user’s session, the lock is removed and we are then free to make configuration changes. In addition, once someone does lock the configuration mode, a system message is sent to inform all other users: