To change the password for a user account in AlmaLinux, you can use the passwd
command.
The syntax for the passwd
command is:
passwd [username]
For example, to change the password for the user tom
, you would run the following command:
passwd tom
This will prompt you for the current password for the user tom
, as well as the new password. You will need to enter the new password twice to confirm it.
If you are changing the password for the root user, you will need to use the sudo
command. For example:
sudo passwd root
This will prompt you for the root password, as well as the new password for the root user.
You can also use the passwd
command to change your own password. To do this, you can simply run the passwd
command without specifying a username.
Here are some additional things to keep in mind when changing passwords in AlmaLinux:
- The new password must be at least 8 characters long and must contain at least one uppercase letter, one lowercase letter, and one number.
- The new password cannot be the same as the old password.
- You cannot change the password for a user who is currently logged in.
Here are the steps on how to change a user password in AlmaLinux via the command line:
- Log in to the server as the root user.
- Run the
passwd
command followed by the username of the user whose password you want to change. For example, to change the password for the usertom
, you would run the following command:
passwd tom
- The system will prompt you for the current password for the user
tom
. Enter the current password and press Enter. - The system will prompt you for the new password. Enter the new password and press Enter.
- The system will prompt you to confirm the new password. Enter the new password again and press Enter.
The password for the user tom
has now been changed.
You can also change a user password in AlmaLinux via the graphical user interface (GUI). To do this, follow these steps:
- Open the System Settings.
- Click on the Users tab.
- Select the user whose password you want to change.
- Click on the Change Password button.
- Enter the current password for the user and press Enter.
- Enter the new password and press Enter.
- Confirm the new password and press Enter.
The password for the selected user has now been changed.