To change the password of a user account on a Linux system, you can use the passwd
command.
Here's an example of how to use passwd
to change the password of the current user:
$ passwd Enter your current password: Enter your new password: Re-enter your new password:
If you want to change the password of another user, you can use sudo
to run the passwd
command as the root user. For example, to change the password of the user jane
, you can run the following command:
$ sudo passwd jane Enter your current password: Enter new password for user jane: Re-enter new password for user jane:
Note: You will need to have the necessary privileges to run the
sudo
command.
It's also a good idea to choose a strong password to protect your account. A strong password is one that is difficult for others to guess or crack using automated tools. It should be at least 8 characters long and include a mix of upper and lower case letters, numbers, and special characters.