Results 1 to 6 of 6

Thread: Ooops. I oofed up pretty badly on a chown. How to restore sudo access?

  1. #1
    Join Date
    Jul 2007
    Location
    Augusta, GA
    Beans
    216
    Distro
    Ubuntu 9.10 Karmic Koala

    Ooops. I oofed up pretty badly on a chown. How to restore sudo access?

    Here's the setup:

    I have my shared drive that I keep my documents folders on that is used between Ubuntu and Windows 7. I created symlinks to everything, but then my /home partition I actually do have set up started getting bogged down, since I didn't leave much space there. As such, I moved my .wine folder over to said drive and created a symlink to it.

    Well, now whenever I try to run something in wine, I was being told I wasn't the owner. Sure enough, I look at my .wine link, and root owns it. Well, genius me decides to run the following:
    sudo chown -RLv justin .wine
    Long story short, now whenever I try to do anything sudo, I get this:
    sudo: /etc/sudoers is owned by uid 1000, should be 0
    sudo: no valid sudoers sources found, quitting

    If I run whatever I was trying to sudo now without sudo, I'm root. Great.

    How can I get my stuff back to normal?

  2. #2
    Join Date
    Nov 2008
    Beans
    479
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Ooops. I oofed up pretty badly on a chown. How to restore sudo access?

    If it's just the sudoers file, then boot into recovery mode, choose root, and chown the file back to root. But I'm afraid there's more in store for you Back up before you reboot!
    5127d464-4548-4993-a138-f546f2fd2a33

  3. #3
    Join Date
    Oct 2008
    Location
    /dev/my_house
    Beans
    214
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Ooops. I oofed up pretty badly on a chown. How to restore sudo access?

    So you did this:
    Code:
    sudo chown -RLv justin .wine
    And got this:
    Code:
    sudo: /etc/sudoers is owned by uid 1000, should be 0
    sudo: no valid sudoers sources found, quitting
    Well, you shouldn't have used the -L flag or the -v flag.

    You seem to not be TRULY root, you just have root control.

    NO GUARANTEE: proceed at your own risk:

    Try:
    Code:
     chown -RLv root:root .wine
    to restore the ownership to root.

    Then:
    Code:
    chown root:root /etc/sudoers
    to restore ownership of /etc/sudoers to root (UID 0).

  4. #4
    Join Date
    Jul 2007
    Location
    Augusta, GA
    Beans
    216
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Ooops. I oofed up pretty badly on a chown. How to restore sudo access?

    Rebooting and running chown root:root /etc/sudoers worked, but now for some reason it still won't let me change the ownership of the .wine directory and I have to run wine stuff as sudo, which is quite annoying. If I try it from the command prompt, I get an error that .wine isn't a directory; if I try it from a gksudoed nautilus, I can select myself from the dropdown list, but it then immediately reverts back to root.

    Does that have anything to do with the fact that it's symlinked to an NTFS drive?

  5. #5
    Join Date
    Nov 2008
    Beans
    479
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Ooops. I oofed up pretty badly on a chown. How to restore sudo access?

    Quote Originally Posted by justinmiller87 View Post
    ...
    Does that have anything to do with the fact that it's symlinked to an NTFS drive?
    I think so, NTFS file permissions are different from Linux. You can use uid=1000 in the mount options to change the owner of ALL files within that partition, but I would recommend using NTFS partitions to store data (photos, videos, documents,...), not configuration files, programmes etc (" system files") anyway.
    5127d464-4548-4993-a138-f546f2fd2a33

  6. #6
    Join Date
    Jul 2007
    Location
    Augusta, GA
    Beans
    216
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Ooops. I oofed up pretty badly on a chown. How to restore sudo access?

    Quote Originally Posted by arrange View Post
    I think so, NTFS file permissions are different from Linux. You can use uid=1000 in the mount options to change the owner of ALL files within that partition, but I would recommend using NTFS partitions to store data (photos, videos, documents,...), not configuration files, programmes etc (" system files") anyway.
    It pretty much is being used for data only. In Windows 7, that partition is my f: drive, and I moved my entire users profile onto it. Then when I installed Ubuntu, I symlinked to those folders from /home in order to maintain data integrity. I only moved and symlinked .wine because I was running out of room on my small /home partition. Maybe I should switch it back and figure out something else I could get rid of.

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
  •