1、使用passwd命令锁定与解锁账号
[[email protected] ~]# passwd -l lxj --- -l 锁定 Locking password for user lxj. passwd: Success [[email protected] ~]# passwd -S lxj --- 查看状态 lxj LK 2016-06-20 0 99999 7 -1 (Password locked.) [[email protected] ~]# [[email protected] ~]# passwd -u lxj --- 解锁 Unlocking password for user lxj. passwd: Success [[email protected] ~]# passwd -S lxj lxj PS 2016-06-20 0 99999 7 -1 (Password set, SHA512 crypt.)
2、使用usermod命令锁定与解锁账号
[[email protected] ~]# usermod -L lxj [[email protected] ~]# passwd -S lxj lxj LK 2016-06-20 0 99999 7 -1 (Password locked.) [[email protected] ~]# usermod -U lxj [[email protected] ~]# passwd -S lxj lxj PS 2016-06-20 0 99999 7 -1 (Password set, SHA512 crypt.) [[email protected] ~]#
时间: 2024-10-08 09:24:06