- Log in to the server with the root account (or an account with sudo permissions)
- Use commands
passwd + 想要修改的用户名
, for example:passwd record
you will be prompted to enter a new password - After entering the new password, you will be prompted to enter it again and then just remember it.
- Seeing
passwd: all authentication tokens updated successfully
means that the modification was successful
Notice:
- Changing the password does not require restarting the server.
- You need to have sudo permissions, otherwise you will be prompted for insufficient permissions.
- The username can
/etc/shadow
be found below, as well as the encrypted password, but it is one-way encrypted.