Making sudo ask for a password?

Discussion in 'Linux' started by ikajaste, Jan 18, 2009.

  1. ikajaste

    ikajaste

    Joined:
    Oct 9, 2008
    Messages:
    17
    Likes Received:
    0
    I would like my AA1 to ask for a password when I try to execute a command with sudo. Has anyone else done this? How to do it?

    I think I already have the solution, but I'm afraid to test it. As I understand it, you can edit this behaviour by editing the file /etc/sudoers. The important part is:

    Code:
    ## Allows people in group wheel to run all commands
     %wheel	ALL=(ALL)	ALL
    
    ## Same thing without a password
     %wheel	ALL=(ALL)	NOPASSWD: ALL
    From /etc/group I see that "wheel" is a group that has "root" and "user" in it. I figure the safest way would be to make the nopasswd -rule affect only root user, instead of the wheel group. So the code should be changed to:

    Code:
    ## Allows people in group wheel to run all commands
     %wheel	ALL=(ALL)	ALL
    
    ## Same thing without a password
     %root	ALL=(ALL)	NOPASSWD: ALL
    This way the change won't affect the root user (which I figure shoudn't be messed with). Am I correct in this? Has anyone else done this? Will this break my system and make it impossible to change the file back? Or is there a better way achieve what I want? I would try this myself of course, but I'll first have to make sure my system backup works, and that's a bigger process...
     
    ikajaste, Jan 18, 2009
    #1
  2. ikajaste

    daldred

    Joined:
    Aug 25, 2008
    Messages:
    887
    Likes Received:
    0
    There arfe things which are run during the One's startup which are run as user but require root permission - this is a Bad Thing, but is the way Acer set it up. If sudo requires a password, they'll break.

    There's a post somewhere in the forums about how to deal with the issue so that the scripts can run but sudo can be 'normalised' - search for 'policykit' and you'll find it somewhere on the hit list!
     
    daldred, Jan 18, 2009
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.