What is the affect of executing "sudo passwd" on a system without a root account?

I've just used "sudo passwd" instead of "passwd" on a system by mistake and I'm wondering what the affect of this would be. There are two users on the system, my user account which has sudo privileges and another with sudo privileges belonging to the server administrator. The system does not have a root account so I am wondering what exactly has been changed by using that command. When I executed it it prompted for new password which I gave and confirmation of that. Following that there was no further output.


Solution 1:

Are you sure there is no root account? Is there not a root row in /etc/passwd? I imagine passwd would complain if you try to set a password on a user that does not exist. I think there is a root user and you just set that user's password. You probably want to remove the password again using passwd -d.

Solution 2:

Ubuntu does have a root user account. You just enabled it. To test this, try logging in as root and giving the password you just created at the prompt. You will be logged in as root.

Solution 3:

In a Linux system... there is always a root account. Most of the time it is configured to prevent users from logging in as root, but it still exists. "sudo passwd" will set a password for the user root. In some cases, this will do nothing, as root is not permitted to login. In others, it will actually enable the root account for login. (depending on the system's configuration and how the root-account was disabled)

Solution 4:

The effect is now you can run su.
Every linux distro has a root account, while some just disabled login for root, for security concerns. See Is "sudo su -" considered a bad practice? for more information.
In short, sudo is logged while sudo su isn't. When you run su, you use your root password (set by sudo passwd), while you sudo, you use your account's password.