Find the answer to your Linux question:
Results 1 to 8 of 8
i try to run the sudo command but i get the following output Code: sudo: can't open /etc/sudoers: Permission denied any ideas?...
  1. #1
    Just Joined!
    Join Date
    Apr 2008
    Posts
    13

    sudo not working??

    i try to run the sudo command but i get the following output
    Code:
    sudo: can't open /etc/sudoers: Permission denied
    any ideas?

  2. #2
    Linux User
    Join Date
    Feb 2006
    Posts
    484
    The errormessage contain the exact answer.

    check the permission of /etc/sudoers
    Code:
    ls -l /etc/sudoers
    if it looks like
    -rw--------

    you need to set the read permission for anybody , you must be root to do this
    Code:
    chmod 644 /etc/sudoers
    
    or
    
    chmod +r /etc/sudoers

  3. #3
    Just Joined!
    Join Date
    Apr 2008
    Posts
    13
    i do exactly that and now i get this output
    Code:
    sudo: /etc/sudoers is mode 0644, should be 0440

  4. #4
    Linux Newbie
    Join Date
    Jul 2005
    Location
    Australia (Down Under)
    Posts
    141
    this may or may not help..


    i dont use sudo i think that is more for ubuntu and other distros. if i wanna do something that needs sudo i login as root and then do the command.

    to login as root

    open a terminal

    Applications > Accessories > Terminal

    then i type

    su

    and i am prompted for my password


    does this help?.. is that what you were looking for?

  5. #5
    Linux User
    Join Date
    Feb 2006
    Posts
    484
    check the group owner of the file and add yourself to the group
    or change the group owner of the file to your group
    and set back the permissions to 0440

  6. #6
    Linux Engineer Thrillhouse's Avatar
    Join Date
    Jun 2006
    Location
    Arlington, VA, USA
    Posts
    1,377
    Quote Originally Posted by iwanabeguru View Post
    check the group owner of the file and add yourself to the group
    or change the group owner of the file to your group
    and set back the permissions to 0440
    /etc/sudoers is usually owned by the system group and, in general, it's not a great idea to add regular users to the system group just so they can use sudo. At the same time, it's also not a good idea to change the group owner of the sudoers file to anything other than system.

    Have you tried:
    Code:
    su -
    chmod 440 /etc/sudoers
    ?

  7. #7
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    951
    I'm puzzled by this. My /etc/sudoers file is also 440 and is owned by root and the root group but I have no problems in using sudo. I checked the permissions of the sudo program and found that it runs suid; that gives it access to /etc/sudoers regardless of the restricted permissions. Perhaps fkim's sudo does not have the suid bit set.

    Try ls -l /usr/bin/sudo and check that the first set of permissions are rws, not rwx.
    "I'm just a little old lady; don't try to dazzle me with jargon!"

  8. #8
    Just Joined!
    Join Date
    Apr 2008
    Posts
    13
    the output of ls -al /usr/bin/sudo is
    Code:
    -rwsr-xr-x 2 root root 91700 2006-04-15 10:39 /usr/bin/sudo
    so i dont think the problem is there..i pretty much have no idea coz av tried to look all over but i get nothing

Posting Permissions

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