Find the answer to your Linux question:
Results 1 to 4 of 4
I would like to make a few commands bypass the sudo authentication. Specifically: mount shutdown,poweroff,halt,reboot, etc. netcfg All other commands are reserved for the wheel group, and they need password. ...
  1. #1
    Linux Newbie egan's Avatar
    Join Date
    Feb 2009
    Location
    Mountain View, CA
    Posts
    132

    Help with /etc/sudoers -- Command Exceptions



    I would like to make a few commands bypass the sudo authentication. Specifically:

    mount
    shutdown,poweroff,halt,reboot, etc.
    netcfg

    All other commands are reserved for the wheel group, and they need password. I want the above commands to be executable by anyone in the users group, with a password.

    Any help would be appreciated. I also would like advice about the the possible security problems with the mount command usable by everyone (just for my information).

  2. #2
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,653
    Code:
    %users ALL = NOPASSWD: /sbin/shutdown, /sbin/reboot, /sbin/mount, /sbin/umount
    and whatever other commands you want

    I believe the file is read in order, so later contradictory rules would take precedence. (ie, probably put it at the end of the file)

  3. #3
    Linux Newbie egan's Avatar
    Join Date
    Feb 2009
    Location
    Mountain View, CA
    Posts
    132
    Thanks. That works quite nicely.

  4. #4
    Just Joined! chris81's Avatar
    Join Date
    Jan 2009
    Posts
    62
    I think you don't have to specify the /sbin/umount command, because when someone uses the mount commands, it writes into /etc/mtab user=NAME. This way, the user NAME can use the umount command.

Posting Permissions

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