Results 1 to 3 of 3

Thread: sudo for just a folder

  1. #1
    Join Date
    Nov 2007
    Location
    Daytona Beach, FL
    Beans
    131
    Distro
    Ubuntu 10.04 Lucid Lynx

    sudo for just a folder

    Afternoon all ....

    We have a dev server that some outside people are working on. Most of their work they can do as user X, but one thing involves restarting a service that only root can do.

    So, I am wondering in the sudoer's file, can you say this user can sudo ONLY to folder X?

    Trying to read the doc's/man page, but usually get better results consulting the forum.

    Tnx

  2. #2
    Join Date
    May 2006
    Location
    Switzerland
    Beans
    2,541
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: sudo for just a folder

    You can add a certain username or a group and then let them execute certain things ... without password if you want.

    Example from my own system:

    Code:
    # Members of admin group may open VPN's via tuncfg
    %admin ALL=NOPASSWD: /sbin/tuncfg
    
    # Same for Hamachi users here:
    %hamachi ALL=NOPASSWD: /sbin/tuncfg
    
    # OpenVPN for John
    john	ALL=NOPASSWD: /usr/sbin/openvpn --config /etc/openvpn/customers/client.conf
    So the result here is that these people and groups may execute above commands --and _ONLY_ exactly above commands-- without being asked a password.

    John above can even open VPN tunnels ... but only if he triggers the command exactly as above.

    I guess this is what you want?

  3. #3
    Join Date
    Nov 2007
    Location
    Daytona Beach, FL
    Beans
    131
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: sudo for just a folder

    "guess", it was right on the head. Reading all the command alias stuff, etc. all solved with one clean real-life example!

    Thanks a lot!

Tags for this Thread

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
  •