Results 1 to 5 of 5

Thread: Sudo: unkown user: root error (Please Help!)

  1. #1
    Join Date
    Apr 2011
    Location
    California
    Beans
    3
    Distro
    Ubuntu

    Angry Sudo: unkown user: root error (Please Help!)

    Ok so first off, I'm a TOTAL newbie! I'm just learning as I go so thank god this is a test machine. Anyway, this is what happened...

    I was using vi to edit the passwd file within etc/passwd.
    I wasn't too sure how to use it completely and ended up ruining the first line of code:

    "moot:0:0:root:/root:/bin/bash" 1 simple little word and instead of root i have "moot" lol.

    As I tried to change it back I kept getting the error "E45: 'readonly' option is set (add ! to override)"
    ok...I then proceed to type ":w!"
    then I get ""passwd" E212: Can't open file for writing".

    The permissions on the passwd file are "-rw-r--r-- 1 moot root 2024 2011-04-22 17:37 passwd"
    I know I need to use chmod to change the permissions but I can't without using the sudo command!
    Everytime I use "sudo chmod 777 passwd" i get an error stating "sudo: unknown user: root".

    Can anyone please help? I don't want to reinstall Ubuntu again. I read somewhere that the passwd- file is the original needed but since I cannot edit or delete the current passwd file there's nothing I can do. Thanks a million in advance.

  2. #2
    Join Date
    Jan 2011
    Beans
    60
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Sudo: unkown user: root error (Please Help!)

    You can use a live CD will give you sudo access automatically. In order to do this you must first boot the live CD, then mount the drive Ubuntu is installed on, then navigate to the passwd file and change it.

  3. #3
    Join Date
    Apr 2011
    Location
    California
    Beans
    3
    Distro
    Ubuntu

    Re: Sudo: unkown user: root error (Please Help!)

    Thank you! After doing some digging, I performed Live CD solution. I had to insert Live CD and copy passwd file from cd to HDD installation of ubuntu using the terminal. I was able to properly copy over the file but was not able to login due to the password for login being incorrect. I tried changing the password for the user but to no avail.

    Final Solution: I said "screw it" and decided to re-install Ubuntu again on HDD. Copying the passwd file from LIVE CD looks like it's the best and easiest option. You might have to do some additional steps after but If it's just a test machine re-install is way easier!

  4. #4
    Join Date
    Mar 2011
    Location
    Germany
    Beans
    330
    Distro
    Ubuntu Mate 18.04 Bionic Beaver

    Re: Sudo: unkown user: root error (Please Help!)

    Hello, xxthegonzxx.

    After you had booted you LiveCD, you should not haved copied the /etc/passwd file of the Live CD to the Ubuntun installation on your harddisk.
    Instead you should have edited the passwd file on your harddisk and corrected the mistyped "moot" to read "root".

    Kind regards,
    Karl

  5. #5
    Join Date
    Apr 2011
    Beans
    484

    Re: Sudo: unkown user: root error (Please Help!)

    Quote Originally Posted by Karlchen View Post
    Hello, xxthegonzxx.

    After you had booted you LiveCD, you should not haved copied the /etc/passwd file of the Live CD to the Ubuntun installation on your harddisk.
    Instead you should have edited the passwd file on your harddisk and corrected the mistyped "moot" to read "root".

    Kind regards,
    Karl
    This ^

    Remember, physical access == root access, that is, anything you could do with root in the actual install can also be done with a boot CD.
    Life is an extraordinarily long concatenation of luck and coincidence.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •