2018-03-01  10:01:06

例1:passwd username 直接修改用户的密码
普通用户可以且只能修改自己的密码,root用户可以修改任何人的密码
[root@localhost ~]# passwd chen
Changing password for user chen.
New password:
BAD PASSWORD: it is WAY too short
BAD PASSWORD: is a palindrome
Retype new password:
passwd: all authentication tokens updated successfully.

例2: 明文直接修改用户密码
[root@localhost ~]# echo "afasf" |passwd --stdin chen
Changing password for user chen.
passwd: all authentication tokens updated successfully.

例3:锁定某个用户的密码不能修改(在锁定的情况下,root用户仍然可以修改其密码)
[root@localhost ~]# passwd -l chen
Locking password for user chen.
passwd: Success

[chen@localhost ~]$ passwd
Changing password for user chen.
Changing password for chen.
(current) UNIX password:
passwd: Authentication token manipulation error

例4:解锁某个用户,
命令格式:root执行:passwd -u xxx -u:unlock

[root@localhost ~]# passwd -u chen ------------陈的密码保护被解除
Unlocking password for user chen.
passwd: Success
[root@localhost ~]# su - chen

[chen@localhost ~]$ passwd ------------- 此时输入的密码要求:不能太短和字母和数字组合(root下无此要求)
Changing password for user chen.
Changing password for chen.
(current) UNIX password: ------------- 输入当前的密码
New password:
BAD PASSWORD: it does not contain enough DIFFERENT characters
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

最新文章

  1. 【转载】说说JSON和JSONP,也许你会豁然开朗,含jQuery用例
  2. [Linux] xargs
  3. 【POJ 3020】Antenna Placement(二分图匹配)
  4. java String与Byte[]和String 与InputStream转换时注意编码问题。。。
  5. 【转】Git 少用 Pull 多用 Fetch 和 Merge
  6. http get with body data
  7. 每天一个linux命令(53)--ps命令
  8. Java中的常量治理
  9. vue基础学习(二)
  10. Netfilter的使用和实现
  11. flutter 登录后跳转到根路由
  12. Asp.Net Core 程序部署到Linux(centos)生产环境(二):docker部署
  13. Host 'xxx' is not allowed to connect to this MySQL server.
  14. es6,es7,es8
  15. JavaScript中面相对象OOP
  16. Python : *args和**kwargs是什么东东呢?
  17. Angular injector注入器
  18. Keras和tf关系【转载】
  19. git push异常
  20. SharePoint 2016 IT Preview的新feature列表

热门文章

  1. hihoCoder 1044 : 状态压缩·一 状压dp
  2. nyoj913 取石子(十) SG函数 + Nimm博弈
  3. eclipse快捷键及设置
  4. 4.1 PCIe总线的基础知识
  5. RTlinux3.2安装
  6. RGMII,MII,GMI接口
  7. SQL语句查询时防止SQL语句注入的方法之一
  8. 【php】PHP环境整合
  9. PHP常见错误
  10. STL list 的insert()和erase()