linux-1 passwd 修改用户密码

来源:互联网 发布:出版社运作知乎 编辑:程序博客网 时间:2024/05/21 14:53
passwd 修改用户密码及有效期

##passwd 修改用户密码[root@localhost]# passwdChanging password for user root.##改变超级用户密码New password:  ##输入密码BAD PASSWORD: The password is shorter than 8 charactersRetype new password:  ##确认密码passwd: all authentication tokens updated successfully.[student@localhost Desktop]$ passwdChanging 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 用户密码如下




passwd        参数            用户名称
    -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 信息







原创粉丝点击