linux - Restrict which files in a directory can be deleted -


i have 1 directory in .sh file , other files exist. want restrict deletion of .sh files , remaining can deleted user means user can't delete .sh files directory.

is there way can handle via configuration?

please assist.

sudo bash  > id uid=0(root) gid=0(root) groups=0(root) > touch aa > touch aa.txt > chattr +i aa.txt > rm aa.txt  rm: remove regular empty file ‘aa.txt’? y rm: cannot remove ‘aa.txt’: operation not permitted > rm aa rm: remove regular empty file ‘aa’? y 

using chattr can makes files unremovable


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -