linux系统用户锁定与解锁

1、使用passwd命令锁定与解锁账号

[root@rhel7 ~]# passwd -l lxj    --- -l 锁定
Locking password for user lxj.
passwd: Success
[root@rhel7 ~]# passwd -S lxj    --- 查看状态
lxj LK 2016-06-20 0 99999 7 -1 (Password locked.)
[root@rhel7 ~]# 
[root@rhel7 ~]# passwd -u lxj    --- 解锁
Unlocking password for user lxj.
passwd: Success
[root@rhel7 ~]# passwd -S lxj
lxj PS 2016-06-20 0 99999 7 -1 (Password set, SHA512 crypt.)

2、使用usermod命令锁定与解锁账号

[root@rhel7 ~]# usermod -L lxj
[root@rhel7 ~]# passwd -S lxj
lxj LK 2016-06-20 0 99999 7 -1 (Password locked.)
[root@rhel7 ~]# usermod -U lxj
[root@rhel7 ~]# passwd -S lxj
lxj PS 2016-06-20 0 99999 7 -1 (Password set, SHA512 crypt.)
[root@rhel7 ~]# 

 

posted on 2016-06-21 14:46  遠離塵世の方舟  阅读(50121)  评论(0编辑  收藏  举报

导航