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