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
Я случайно изменил строку для root в / etc / passwd и изменил ее имя. Чтобы исправить это, я попытался использовать sudo для изменения этого файла, но он не позволяет мне sudo, потому что sudo не может найти пользователя root, так как я переименовал его.
Я нахожусь на 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
If @sputnick's answer does not work, another solution would be to boot a live disc and mounting your drive in that, then use the live root user to adjust it.