Learning how to change password in Linux Mint is essential to keeping your system secure and everything else on it. And we’re here to help you do just that.
Passwords are used for authenticating end users. Based on a username and password, you will be able to identify who a particular user is. There are specific rules for a strong password; the password must contain special characters and a combination of upper and lower case letters.
You must set a strong password for your system so a malicious user can’t crack it. You may sometimes share the password with your immediate relatives or friends. Hence, you may want to change your password over time.
How to Change a Password in Linux Mint
It is also advisable to change your password frequently to avoid system attacks. Changing your password in Linux Mint is quite simple and we will explain it in the following paragraphs. There are two ways of changing passwords in Linux Mint:
- Using the Terminal window
- Graphical user interface (GUI)
We will discuss both of these methods briefly now.
Changing password using Terminal
The simplest way to change passwords is to use the password command. Click on the system menu and select Terminal. There are two ways of changing passwords.
Tip: The root user is the super user of the system and holds the highest administrative privileges. In comparison, sudo is an ordinary user who can run administrative tasks.
Changing password with root user
Run the following command on the Terminal:
You will be asked for the root password. After providing the password, you will gain root privileges. Now type passwd in the Terminal.
As discussed in the next section, you can also provide the name of the user whose password is to be changed. Please enter the new password and then also confirm it. The password will then be updated successfully.
Note: This method will only work if you have changed your password at least once.
Changing the password with the sudo command
In the Terminal, type the following command:
You will be asked to provide your current password. Provide your current password, and then you can enter a new password.
Note: You might get confused when changing the password as the cursor doesn’t move, nor will you be displayed the characters you typed while providing the password. To change the password of another user, give the username after the password command. The following command illustrates that:
$sudo passwd khan
Using the above command, you will be able to change the password of the user khan.
Changing passwords using a graphical user interface (GUI)
Inexperienced users should generally use graphical user interfaces. The user interface enforces the policies for a strong password. Hence, you can’t skip these rules. However, the command line interface can skip these rules for a strong password. To change your password, follow the following instructions.
Go to Menu > Administration > Users and groups and select the user. Then, click on the password string. A new dialog box will appear where you will be asked for a new password. Enter the new password. If the password matches the requirements for a strong password, you can change it.
If the password doesn’t match the policy for a strong password, the following error will be displayed:
Changing root passwords
You often require root permissions to perform specific tasks on the system. This requires you to log in as a root user. There should be some mechanism to restore, recover or change the root password. We now share a few methods to change the root password.
Changing root password with sudo permissions
On your Terminal, type the following command:
$sudo passwd root
Enter the sudo password for your system. Provide the password. Enter the new password for the root user and confirm it. A success message will be displayed, and the password will be changed.
Changing root password with root permissions
This method works if you know the root user password. On your Terminal, type the following command:
You will be prompted for the password of the root user. After providing the password for the root user, you will gain root access. And then, using the password command, you will be able to change the root password. Please type the following command and provide the new password and confirm it.
We discussed two approaches to changing your password in Linux Mint. You can change it through the command line or the graphical user interface. Using the Terminal window, we discussed two approaches to changing the passwords (i.e., using root privileges or the sudo command).
The first approach will work only if you have changed the password at least twice. Changing your password after a certain period is advisable to avoid security breaches. You may be working in the form of a team and share your password.
If this guide helped you, please share it.