CentOS 6 Linux has two ways to lock a password:passwd -lusermod -LToday I found out, that they do something different.passwd writes two exclamation marks into the shadow file.# passwd -d test1Removing password for user test1.passwd: Success# passwd -l test1Locking password for user test1.passwd: Success# passwd -S test1test1 LK 2014-01-14 0 99999 7 -1 (Password locked.)# grep test1 /etc/shadowtest1:!!:16084:0:99999:7:::But usermod writes only one.# passwd -d test1Removing password for user test1.passwd: Success# usermod -L test1# passwd -S test1test1 LK 2014-01-14 0 99999 7 -1 (Password locked.)# grep test1 /etc/shadowtest1:!:16084:0:99999:7:::Is this only a cosmetic inconsistency or is there a meaning for the different lock indicators?Funny things happen, if you mix the two commands:Lock an account with passwd:# passwd -l test1Locking password for user test1.passwd: SuccessUnlock it with usermod:# usermod -U test1And surprise it is still locked:# passwd -S test1test1 LK 2014-01-14 0 99999 7 -1 (Password locked.)Bug or feature?
Two ways to lock a password but only one to unlock
centos;password;shadow;passwd