0
I suggest that I have a log file with 666 permission and its owner is alice. So user 'bob' can change its owner by this:
cp log log.temp; rm log; mv log.temp log
So how can I fix this risk?
0
I suggest that I have a log file with 666 permission and its owner is alice. So user 'bob' can change its owner by this:
cp log log.temp; rm log; mv log.temp log
So how can I fix this risk?
1
As Andrey says above, bob can only do what you say if he has rights over the directory which contains the file. Just change the dir permissions to xx5 if you want bob to access but being unable to create new files.
from Understading UNIX permissions
Access permissions for files and folders mean different things from the user standpoint.
For Files
For Directories
Put its ownership as 600? – hd1 – 2013-01-09T03:54:06.830
2'bob' can do that only if he has write permissions for the directory containing the file. – Andrey Voitenkov – 2013-01-09T08:34:58.977