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.


你可能感兴趣的:(Centos7用户和组)