There are the simple steps to reset the user’s password in CentOS or RHEL server. Root password is super user which can reset any user’s password in the server. Meanwhile, the other users, for example demoroot, only can reset it’s own password as per below command :
1. Root user can reset any user’s password :
[root@server ~]# passwd demoroot
Changing password for user demoroot.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
2. Normal user only can reset it’s own password :
[demoroot@server ~]$ passwd
Changing password for user demoroot.
Changing password for demoroot
(current) UNIX password:
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.