I accidentally modified the line for root in /etc/passwd and changed its named. To fix it I tried using sudo to modify this file, but it does not let me sudo because sudo can't find the root user since I renamed it.
II am on ubuntu.
Try :
sudo -u new_wrong_root_user
If you can't, reboot on a live-cd, then in terminal :
mkdir target
mount /dev/sda1 target # sda1 if / is the first partition of the first drive
vim target/etc/passwd