I am trying make a immutable file that is anyone can read only and can't do any modification into it. i.e - No one can write into it or delete it or move it. For this is referred chattr this LINUX command.
chattr +i filename.txt
This command makes file immutable but if any other person logged into root in linux then he can remove this immutable by
chattr -i filename.txt
So I want to make something script/code/command, anything so when I make file immutable by then only by running these script/code/command then and then only file should be mutable so anyone can modify this, otherwise not.
Also I referred this chattr github code. I came to know that they used ioctl function and flags to mask this file and made immutable but I didn't find anything more except this.
There is another way to do it in
Solaris OS by using zfs but it is not working in UBUNTU because of different platform. Is there any way to do it?
Any suggestion or solution appreciated.