What happens if you do sudo passwd without specifying a user?

I wanted to change my own password (as an admin) so I did the following command:

sudo passwd

and then it prompted for a password but when I tryed to relog, my password was not changed. I'm now wondering what password did I changed since it did prompted me to enter a password but I'm not sure what password did it changed exactly.

I know that if I do sudo passwd <MY_USER> it works, I'm just wondering without a user what happens.

Thank you


(Strangely, this seems to not be documented in man passwd...)

If no username is specified, it defaults to the username of the user running passwd. Of course, as always running a program with sudo (without additional arguments) makes it behave as if it were run by root, so sudo passwd is equivalent to sudo passwd root.