0
0
I have two users userA and userB. userA has permission over a file named cache
. I want to give permission to userB to remove the file. I have made following entry in /etc/sudoers
file :
userB ALL=(userA) NOPASSWD:/bin/rm /opt/cache
When I type sudo -u userA /bin/rm /opt/cache
, it says permission denied. However cache has 777
permission. Please let me know where I am doing it wrong.
Usually
/opt/cache
is a directory (I see you edited "directory" to "file" but I'm not sure why?). You needrm -r
to remove a directory. Also you may get weird errors if/opt/cache
is a mount point. Are you using SELinux, by chance? – Jason C – 2014-06-17T06:31:11.897cache is a file in my case. I mistakenly typed directory there and I am not using SELinux. Also, it's not a mount point. For more clarity please find output of ll :
-rwxrwxrwx. 1 userA userA 87475 Jun 17 06:39 cache
– newbie17 – 2014-06-17T06:51:01.290