Users can only change their own password. However, there is always a sudo/root (SuperUser) account. Root users can change the password of any account, including their own. By default, the root user is locked.
How do I reset the root password with sudo?
First of all, sudo executes commands as root, so resetting the actual root password while accessing as root to begin with usually isn’t a problem. You already have root access through sudo, so there’s little change. (This assumes you don’t have a setup that restricts user commands but allows them to sudo passwd …
What does Sudo passwd root do?
So sudo passwd root tells the system to change the root password, and to do it as though you were root. The root user is allowed to change the root user’s password, so the password changes. The system is working as designed.
How do I change the root user password in Linux?
An alternative is to switch to the root user and then run the passwd command to change the root password. 1. First, open the terminal ( CTRL + ALT + T ). 2. Switch to the root user with the command:
What does Sudo do in Linux?
The sudo command tells the system to run a command as a superuser, or root user. When you run a function using sudo, you’ll usually have to enter your password.