passwd 修改用户密码及有效期
##passwd 修改用户密码
[root@localhost]# passwd
Changing password for user root. ##改变超级用户密码
New password: ##输入密码
BAD PASSWORD: The password is shorter than 8 characters
Retype new password: ##确认密码
passwd: all authentication tokens updated successfully.
[student@localhost Desktop]$ passwd
Changing password for user student. ##改变普通用户密码
Changing password for student.
(current) UNIX password: ##输入当前密码
New password:
BAD PASSWORD: The password is the same as the old one ##和原始密码不能相似
New password:
BAD PASSWORD: The password fails the dictionary check - it is too simplistic/systematic ##密码必须是无序数字+字母
New password:
BAD PASSWORD: The password is shorter than 8 characters ##密码必须>8位
修改root 密码效果如下
修改student 用户密码如下
-S student ##用户密码信息
--status student ##用户密码信息
-l student ##锁定帐号
-u student ##解锁
-n 1 student ##设定密码最短有效期
-x 30 student ##设定密码最长有效期
-w 3 student ##警告期
-i 2 student ##设定用户非活跃天数
-d student ##清除用户密码
##监控passwd密码信息命令如下:
watch -n 1 passwd -S student
修改之前 student 信息
修改之后的 student 信息