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.
相关文章
- 【VS开发】【miscellaneous】windows(64位)下使用curl命令
- Linux-命令:ll命令报错-bash: ll: command not found
- Linux命令:free【Mem:显示当前系统中的内存使用和空闲情况】【Swap:显示被内核占用的内存缓冲区】
- 使用nc命令检查Linux系统远程端口是否打开
- ubuntu部分端口命令的使用----开启端口/开启防火墙
- linux pgrep命令的使用
- hadoop集群之HDFS和YARN启动和停止命令
- nginx 服务器重启命令,关闭
- laravel homestead vagrant box安装使用,问题,及相关命令
- 每天一个linux命令(6/18):lsof命令
- linux 使用中的一些命令
- Linux命令·ln
- Laravel5.5执行表迁移命令出现表为空的解决方案
- Linux命令su、sudo、sudo su、sudo -i使用和区别
- Linux route命令详解和使用示例(查看和操作IP路由表)
- linux fdisk命令使用
- 关于nc命令使用eof断开连接
- Windows上使用netsh命令设置IP和Wifi
- linux下svn命令使用大全