What is the difference between usermod account locking and passwd account locking? usermodpasswd
From: http://www.apelearn.com/bbs/thread-6658-1-1.html
Passwd-l: Lock the account and add it to the front of the password string !.
Passwd-u removes the password string !.
By default, usermod-L only locks the password and adds it before the password string !.
By default, usermod-U only unlocks the password and removes the password before the string !.
First, lock user1 with passwd, test with usermod, and 1.
Figure 1:
We can see that user1 is added in front of the password !!, The password for test is added !.
Then, use usermod-U twice to unlock user1, 2, and 3.
Figure 2:
Figure 3:
User1 can be used for normal login, 8.
Figure 4:
I personally understand that, whether it is locking an account or locking a password, it is actually adding it in front of the Account Password !, In either way, the password is removed !.
Usermod cannot unlock the account locked by passwd at a time because two accounts are in front of the account locked by passwd !, Usermod only removes one !, Therefore, the user can be unlocked after two usermod operations.