Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: HELP! I can't use sudo!

  1. #1
    Join Date
    Apr 2011
    Location
    Classified
    Beans
    173
    Distro
    Lubuntu

    Exclamation HELP! I can't use sudo!

    When I try to use sudo, I get this error message.
    Code:
    sudo: /etc/sudoers is owned by uid 1000, should be 0
    sudo: no valid sudoers sources found, quitting
    Please help!
    CPU: AMD FX 8120 8-Core Black Edition OC'd to 4.3GHz | Motherboard: Gigabyte GA-990FXA-UD3 | Graphics: Gigabyte Radeon HD 6850 WindForce | Memory: 16GB G.SKILL Ripjaw Series DDR3 1600 | Storage: 3TB total

  2. #2
    Join Date
    Dec 2007
    Location
    The last place I look
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HELP! I can't use sudo!

    did you take ownership of your sudoers file? lets restore it to its default ownership and permissions.

    ok, first open a terminal as root, by hitting Alt + F2, and entering
    Code:
    gksu gnome-terminal
    then in the shell that pops up, enter:
    Code:
    chown root:root /etc/sudoers
    chmod 440 /etc/sudoers
    then open a new terminal (however you usually do it) and see if sudo works again.

    remember, always use visudo to edit your sudoers.
    https://help.ubuntu.com/community/Sudoers
    Last edited by doas777; June 1st, 2011 at 12:55 AM.
    Things are rarely just crazy enough to work, but they're frequently just crazy enough to fail hilariously.

  3. #3
    Join Date
    Jul 2005
    Location
    England
    Beans
    Hidden!

    Re: HELP! I can't use sudo!

    Nice idea, but I think if sudo does not work, neither will gksu, so I suspect the command you suggest using gksu won't work either.

    I think you may need to do all this from recovery mode, so from grub choose that option (usually second in the grub menu), go to a command line and then run those commands direct from the command line interface that you will get.
    DISTRO: Xubuntu 14.04-64bit --- Code-tags --- Boot-Repair --- Grub2 wiki & Grub2 Basics --- RootSudo

  4. #4
    Join Date
    Jun 2009
    Location
    Manchester
    Beans
    87

    Re: HELP! I can't use sudo!

    Can you
    Code:
    su -
    and then chown the file?


  5. #5
    Join Date
    Apr 2011
    Location
    Classified
    Beans
    173
    Distro
    Lubuntu

    Re: HELP! I can't use sudo!

    OK, I tried doas777's advice while in recovery mode per ajgreeny's suggestion and I now can use sudo but I get this, which I suppose isn't that bad considering sudo is working again.
    Code:
    /etc/sudoers.d/README is owned by uid 1000, should be 0
    Thanks for the help so far!
    Last edited by redbikemaster; June 1st, 2011 at 01:30 AM. Reason: Needed to give appreciation where it is due!
    CPU: AMD FX 8120 8-Core Black Edition OC'd to 4.3GHz | Motherboard: Gigabyte GA-990FXA-UD3 | Graphics: Gigabyte Radeon HD 6850 WindForce | Memory: 16GB G.SKILL Ripjaw Series DDR3 1600 | Storage: 3TB total

  6. #6
    Join Date
    Dec 2007
    Location
    The last place I look
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HELP! I can't use sudo!

    Quote Originally Posted by ajgreeny View Post
    Nice idea, but I think if sudo does not work, neither will gksu, so I suspect the command you suggest using gksu won't work either.

    I think you may need to do all this from recovery mode, so from grub choose that option (usually second in the grub menu), go to a command line and then run those commands direct from the command line interface that you will get.
    usually when I get messages about sudo not working (usually a host name not found in the hosts file), gksu still works for me. if the op is lucky, that is the case, if not, recovery mode is the way to go.

    @op, here is what your permissions should be for /etc/sudoers and /etc/sudoers.d/
    Code:
    user@host:~$ ls -al /etc | grep sudoers
    -r--r-----   1 root     root       609 2010-05-31 14:53 sudoers
    drwxr-xr-x   2 root     root      4096 2011-01-22 00:21 sudoers.d
    
    user@host:~$ ls -al /etc/sudoers.d
    total 20
    drwxr-xr-x   2 root root  4096 2011-01-22 00:21 .
    drwxr-xr-x 146 root root 12288 2011-05-31 02:10 ..
    -r--r-----   1 root root   819 2010-04-13 13:37 README
    so based on this, try these modified commands:
    Code:
    chown root:root /etc/sudoers 
    chmod 440 /etc/sudoers
    chown -R root:root /etc/sudoers.d
    chmod  755 /etc/sudoers.d 
    chmod  440 /etc/sudoers.d/*
    recovery mode works as well as any other root shell.
    Last edited by doas777; June 1st, 2011 at 02:05 AM. Reason: updated command to ensure dir permissions are right.
    Things are rarely just crazy enough to work, but they're frequently just crazy enough to fail hilariously.

  7. #7
    Join Date
    Apr 2011
    Location
    Classified
    Beans
    173
    Distro
    Lubuntu

    Re: HELP! I can't use sudo!

    Done. And fixed.

    Thread is now marked as solved!
    CPU: AMD FX 8120 8-Core Black Edition OC'd to 4.3GHz | Motherboard: Gigabyte GA-990FXA-UD3 | Graphics: Gigabyte Radeon HD 6850 WindForce | Memory: 16GB G.SKILL Ripjaw Series DDR3 1600 | Storage: 3TB total

  8. #8
    Join Date
    Jan 2008
    Location
    Canada
    Beans
    208
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: HELP! I can't use sudo!

    Hey there I am having the same issues but when I do what needs to be done it says the files are read only. I am not sure how to fix my issue.
    Ubuntu 13.04
    AMD Phenom II X6 1100T
    Asus M3N-HT Deluxe
    OCZ 8GB Of Ram

  9. #9
    Join Date
    Mar 2011
    Beans
    181

    Re: HELP! I can't use sudo!

    "the files are read only"

    Edit: even after copying that I misread it as ownership...my reply was bogus, but it won't let me delete it (?), so maybe try "sudo chmod +r filename" ... via LiveCD/whatever, then the others.

    Edit2: if that doesn't work, make sure the disk isn't mounted read-only (use gparted or palimpsest).
    Last edited by flemur13013; March 27th, 2012 at 05:43 PM.

  10. #10
    Join Date
    Jun 2008
    Location
    India
    Beans
    33
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HELP! I can't use sudo!

    I am facing the same problem, gksu is not opening. Getting this msg repeatedly.

    sudo: /etc/sudoers is owned by uid 1000, should be 0
    sudo: no valid sudoers sources found, quitting
    sudo: unable to initialize policy plugin


    Kindly let me know what I can do. Tried all soln., none found working.

    TY.

Page 1 of 2 12 LastLast

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
  •