The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

help adding user to sudoers

Discussion in 'General Discussion' started by colet, Apr 26, 2006.

  1. colet

    colet Member

    Joined:
    Apr 26, 2006
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    I've read up on visudo and have added the line:
    myuser ALL=(ALL) ALL

    But myuser still gets the error:
    -bash: /usr/bin/sudo: Permission denied

    Is there something I should restart? Thanks for any tips.

    --
    Cole
     
  2. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    That line looks fine, and as long as you used visudo to edit /etc/sudoers the changes should have stuck.

    You also need to ensure that the binary at /usr/bin/sudo has the correct permissions - by default they are not set correctly for security reasons.

    I have permissions of 4111 on /usr/bin/sudo and this seems to work fine - you certainly need to make sure the 'set UID' bit is set (the 4) otherwise things won't work.

    As for the /etc/sudoers entry, you might want to try using:

    Code:
    user ALL=(ALL) NOPASSWD: ALL
    if you feel brave. I use this for one user, from whose account PHP scripts are run to update content within other accounts. For this reason, I need it to work without having to enter the root password.
     
  3. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Additionally, you probably need to make sure that you're using a normal bash shell for the user and not a jailshell.
     
  4. brianoz

    brianoz Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,146
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    Sounds like a permission error from sudo itself - check the permissions on the sudo binary.
     
  5. colet

    colet Member

    Joined:
    Apr 26, 2006
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    permissions on sudo

    The problem was indeed the permissions on sudo. 4111 did the trick.

    Thanks for the help, all.

    --
    Cole
     
Loading...

Share This Page