I'm trying to modify a file from /etc/ but I can't, because the file I want to modify require root permission and I accidentally erase it.
I tried to use some sudo
commands but I can't because every time i get
unknown user : root
I'm trying to modify a file from /etc/ but I can't, because the file I want to modify require root permission and I accidentally erase it.
I tried to use some sudo
commands but I can't because every time i get
unknown user : root
The error message unknown user : root
occurs when the user root was deleted from /etc/passwd.
Boot a live USB, mount your root partition, and post the contents of /etc/passwd .
If you are missing only root, you can add this at the top of the file
root:x:0:0:root:/root:/bin/bash
If the entire file is blank , corrupt, or incomplete, restore from backup. If you do not have a back up you can try copying the file from the live usb.
In the future, don't edit system files unless you understand what you are doing. When you do, always make a backup copy of the original file and clearly comment the changes you make. Often , but not always, comments start with a #
sudo -e /etc/file
what command did you run ? – Panther Oct 03 '14 at 02:19