A password on the Ubuntu system is a secret string of characters that is used to authenticate a user and protect their account and data. The password confirms the user's identity when logging in or performing actions that require elevated privileges (such as installing software or changing system settings).
Changing your password in Ubuntu (or any other operating system) is important for several reasons:
In Ubuntu, changing your password is done through the terminal using the passwd
command or through the GUI in the system settings.
To change the password in Ubuntu, the passwd
command is used. It is necessary to open the terminal and re-login in it to the root
user:
sudo su
The shell will ask you to enter the administrator password. After successfully entering the code, a prompt will appear as root
.
Now you can perform, directly, the procedure of changing the password:
passwd
After entering this command, you will be prompted to enter the new sudo
password twice.
When it is successfully changed, you can switch back to the regular user shell by executing:
exit
But to use this command to change the code of an account other than your own, you need to use the extended syntax:
sudo passwd [user_name]
The command in this case should be executed via sudo
. After entering this construct, you will also be prompted to enter a new password twice, only for the user specified in the argument.