0

I want to add a user to sudoers, such that the user can do anything in root permission but:

  1. The user can't use mount command;

  2. The user can't access(read or write) to directory /home/protecteddir;

thanks you all very much for the help :)

-1

To restrict the sudoers from mounting, modify your sudoers file as in,

#limit users in group 'sudo' from mounting
%sudo ALL=(ALL) ALL, !MOUNT

To protect a directory from a sudoer, you can try setting using ACL, further information can be found here,

I am not sure this will work since sudo is almost a root access

Setting Access ACLs

  • Preventing calls to mount does not prevent mounting. You'd have to prevent the mount system call, which sudo can't do. ACL won't do anything against root. – Gilles 'SO- stop being evil' Jun 18 '15 at 21:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.