Passwords are one of the most important aspects of computing.They keep our bank accounts, user profiles and computers safe (as long as we don’t reuse passwords). Just to log into our computers, most of us need a password and, for Linux, this is even more important.
Pasi de urmat
Any user can change their password at any time. It is good practice to frequently change your password, and to not reuse or rotate passwords.Open a terminal.
Type in the passwd command to start the password change process. Passwd may look like a spelling mistake, but it is the command to work with passwords on the terminal.
Type in your current password and press Enter.
Type in your new password, press Enter. Then type it in again to confirm that it is correct. Note that Linux will not echo (print) the password to the screen, nor will it show any asterisk indicating password length.
If you are an administrator of many users, there will come a time where a user forgets their password and it will fall to you, or someone with sudo privileges to reset their password. To change another user’s password we use the same command, but specify the user’s name.
- Open a terminal.
- Type in the passwd command along with the user name. To use this command you will either need to be root, or be part of the “sudo” group. In the code example we assume that you are in the sudo group.
- Change the user’s password, and confirm the change.