I want to add a user to sudoers, such that the user can do anything in root permission but:
The user can't use mount command;
The user can't access(read or write) to directory /home/protecteddir;
thanks you all very much for the help :)
I want to add a user to sudoers, such that the user can do anything in root permission but:
The user can't use mount command;
The user can't access(read or write) to directory /home/protecteddir;
thanks you all very much for the help :)
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
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