Find the answer to your Linux question:
Results 1 to 3 of 3
In the sudoer file can I have a user run any command in a directory?? What I mean is I have let say 20 commands that might be accessed by ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Jun 2006
    Posts
    141

    sudo question


    In the sudoer file can I have a user run any command in a directory??
    What I mean is I have let say 20 commands that might be accessed by other command(not alias) but one calls another.
    Can I ,in sudo, code:
    user1 /usr/commands/*
    and this would let them run any command in the /usr/commands directory or
    must I spell out all the commands they are permitted to use?

    thanks
    Mace

  2. #2
    Linux User
    Join Date
    Jun 2007
    Posts
    318
    It should work. Use visudo to edit /etc/sudoers and enter the following:

    Cmnd_Alias CMNDS=/usr/commands/*
    user1 ALL=CMNDS

  3. #3
    Linux Newbie
    Join Date
    Jun 2006
    Posts
    141
    thanks for the reply.
    But now I have another question.
    I may be reading or understanding this wrong so I'm asking for clarification.
    If I add user1 in the sudoers file to perform shutdown,(/sbin/shutdown) will I have to logon as root through user to shutdown the system?
    Can I prevent root from removing files (!rm ) as user1.
    My problem is my boss is putting an incompetent person in to do backups and must sign in as root to bring the system up or execute certain commands.
    I am trying to limit the damages up front.
    thanks
    Mace

Posting Permissions

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