If the /etc/shadow file contains the following token in the second field
* (we can manually put this character by pre-fixing the encrypted string with an *)
! (by using the passwd –l user_name)
user1:*$1$sdiv6Jjp$FG6IYJ4ziL8KLLfo0f8oK/:13876:0:99999:7::: ==> We can put the prefix character (*) to disable the specified user.
user2:!!:14004:0:99999:7::: ==> When we create a new user without changing the default password. The user data in the shadow file will have the prefix character (!) in the second field.
方式一 : With UNIX Command
passwd –l user_name
-l This option is used to lock the specified account and it is available to root only. The locking is performed by rendering the encrypted password into an invalid string (by pre-fixing the encrypted string with an !).
方式二 : 手動停用