Linux安全网 - Linux操作系统_Linux 命令_Linux教程_Linux黑客

会员投稿 投稿指南 本期推荐: 强烈推荐:Ylmf OS 3.0 正式版发布附迅雷高 XP系统下硬盘安装Fedora 14图文教程
搜索:
您的位置: Linux安全网 > Linux入门 > » 正文

linux用户管理实验2:passwd命令

来源: longmuxiaozi 分享至:

课堂笔记,共学共享~~加油!

[root@linuxso.com ~]# passwd test                      test用户设置密码
 
[root@linuxso.com ~]# passwd -S test                           查看test账户的密码信息
test PS 2009-01-08 0 99999 7 -1 (Password set, MD5 crypt.)
 
[root@linuxso.com ~]# passwd -S test1               从未设置过口令的账户其口令为锁定状态
test1 LK 2009-01-07 0 99999 7 -1 (Password locked.)
        
[root@linuxso.com ~]# passwd -d test                           删除test账户的口令
 
[root@linuxso.com ~]# passwd -S test                           查看test账户口令的信息,结果为空口令
test NP 2009-01-08 0 99999 7 -1 (Empty password.)
 
[root@linuxso.com ~]# passwd -l test                            锁定test的口令,test用户就不能自己修改自己的口令了
 
[root@linuxso.com ~]# passwd -S test                           查看test账户口令的信息,结果为锁定状态   
test LK 2009-01-08 0 99999 7 -1 (Password locked.)
 
[root@linuxso.com ~]# passwd -u test                           尝试解锁一个空口令的账户,
Unlocking password for user test.           不知道test用户的口令
passwd: Unsafe operation (use -f to force).    系统提示这样做不安全,如果确认要这么做的话,就用-f强制解锁
 
 
[root@linuxso.com ~]# passwd -uf test                         强制解锁一个空口令的账户
 
[root@linuxso.com ~]# passwd -S test
test NP 2009-01-08 0 99999 7 -1 (Empty password.)密码为空
 
[root@linuxso.com ~]# passwd -k test                           设置test账户只有密码过期失效后,才能更新
Changing password for user test.
New UNIX password:www.linuxso.com      
Retype new UNIX password:www.linuxso.com
passwd: expired authentication tokens updated successfully.

Tags:
分享至:
最新图文资讯
1 2 3 4 5 6
验证码:点击我更换图片 理智评论文明上网,拒绝恶意谩骂 用户名:
关于我们 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 发展历史