sudo - sudoers: allow users to remove from their home directory

07
2014-07
  • bukzor

    I'd like to add a sudoers rule that says users are allowed to remove files from their home directory , but I don't see any way to limit arguments to be a subdirectory of the users' home.

    Is there any way to do this?

    users localhost=/bin/rm -rf $HOME/*
    
  • Answers
    Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

    Related Question

    unix - Get sudoers information for all users on a server
  • Jon Kruger

    I want to collect information on what sudoers actions a user can perform on a server. From what I've read, you can do this with the command sudo -l -U username. However, one server that I have has a slightly older version of sudo (1.6.7p5) and the -U option doesn't seem to exist (I don't own the server so I can't just upgrade to a newer version of sudo).

    Has anyone ever had to collect sudoers information for all users on a server? How would you recommend doing it?

    EDIT: This has to be an automated process, so "just look at the sudoers file" won't work.


  • Related Answers
  • Diablomarcus

    You can just do visudo and see what options each user has.

  • slhck

    As root:

    cat /etc/sudoers > /home/username/sudoerprivs  
    cd /home/username  
    chown username:username sudoerprivs