• 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.

  • 相关阅读:
    Kafka副本管理—— 为何去掉replica.lag.max.messages参数
    Kafka0.8.2.1删除topic逻辑
    【原创】如何确定Kafka的分区数、key和consumer线程数
    【原创】Kafka console consumer源代码分析(二)
    QGIS源码解析和二次开发
    点云数据中的三维信息提取pcl
    Halcon10.0 + VS2010
    Halcon链接库
    python调用Opencv库和dlib库
    cvtColor
  • 原文地址:https://www.cnblogs.com/kaishirenshi/p/8487034.html
Copyright © 2020-2023  润新知