Re: Permission to only one directory
Posted by ErmanArslansOracleBlog on Aug 24, 2021; 8:23am
URL: http://erman-arslan-s-oracle-forum.124.s1.nabble.com/Permission-to-only-one-directory-tp10155p10161.html
It seems there is no easy way for doing this.. Preventing a user from delete its own file..
The easiest solution seems to be the one based on chattr +i..
So if you use chattr +i for a file; even the owner can not delete it..
However; you need to implement in a way that it should be triggered when a new file is created.
So, your user will create a file named TESTFILE in a directory named /TESTDIR, and when that happens, that trigger should be fired and execute the command -> chattar +i /TESTDIR/TESTFILE.. This way, your user altough it is the owner of the file, will not be able to delete the file named TESTFILE... I hope you understand what I mean.. See "inotifywait" for implenenting such a triggering mechanism..