To change the password for a user on Red Hat Enterprise Linux (RHEL), you can use the passwd command. The passwd command is a utility that allows you to change the password for a user account.
To change the password for a user, open a terminal and enter the following command:
sudo passwd username
Replace username with the name of the user whose password you want to change. For example, to change the password for the john user, you would enter the following command:
sudo passwd john
You will be prompted to enter and confirm the new password for the user. Once you have entered the new password, the passwd command will update the password for the user account.
Keep in mind that you must have administrative privileges (e.g., be a member of the sudo group) to change the password for a user using the passwd command.
It's also worth noting that the passwd command can be used to change the password for the current user as well. To change your own password, simply enter the passwd command without any arguments:
passwd
This will prompt you to enter and confirm the new password for your user account.