Centos7设置、修改用户密码



(1) in user UserInGroup, 
we forget the old password or have not set the passwd when creating the user UserInGroup
and we give a wrong (current) UNIX password, 
system returns 'passwd: Authentication token manipulation error',
then we should switch to user root,
use command passwd + user name to reset the user passwd

#################################################
#################################################
[UserInGroup@localhost zlf]$ passwd
Changing password for user UserInGroup.
Changing password for UserInGroup.
(current) UNIX password: 
passwd: Authentication token manipulation error

#################################################
[UserInGroup@localhost zlf]$ su
Password: 
[root@localhost zlf]# passwd UserInGroup
Changing password for user UserInGroup.
New password: 
BAD PASSWORD: The password is shorter than 8 characters
Retype new password: 
passwd: all authentication tokens updated successfully.

#################################################
[root@localhost zlf]# su UserInGroup
[UserInGroup@localhost zlf]$ passwd
Changing password for user UserInGroup.
Changing password for UserInGroup.
(current) UNIX password: 
New password: 
BAD PASSWORD: The password is the same as the old one
New password: 
BAD PASSWORD: The password is too similar to the old one
New password: 
BAD PASSWORD: The password is too similar to the old one
passwd: Have exhausted maximum number of retries for service

[UserInGroup@localhost zlf]$ passwd
Changing password for user UserInGroup.
Changing password for UserInGroup.
(current) UNIX password: 
New password: 
BAD PASSWORD: The password is shorter than 7 characters
New password: 
BAD PASSWORD: The password is shorter than 7 characters
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully.


#################################################
#################################################
(2) we switch to user Group1User1 and reset passwd for user Group1User1
then we witch to user UserInGroup
then user UserInGroup try to change passwd for user Group1User1,
fail with 'passwd: Only root can specify a user name.'
#################################################
[UserInGroup@localhost zlf]$ su
Password: 
[root@localhost zlf]# passwd Group1User1
Changing password for user Group1User1.
New password: 
BAD PASSWORD: The password is shorter than 8 characters
Retype new password: 
passwd: all authentication tokens updated successfully.
[root@localhost zlf]# su UserInGroup
[UserInGroup@localhost zlf]$ passwd Group1User1.
passwd: Only root can specify a user name.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值