I tried using chmod 000 <file>, chown -R root <file> and chgrp sys <file> . But it seems it can still be removed without root permission. When I executed rm <file> , the command line just shown a prompt of override --------- root/staff for <file>? . It can delete the file without asking for root.
Asked
Active
Viewed 155 times
0
Jason Lee
- 111
-
https://apple.stackexchange.com/questions/362662/how-to-delete-a-locked-app-karabiner/ – anki Aug 31 '21 at 02:36
1 Answers
1
So I found what I should do from the link provided from anki .
All I need to do is chflags uchg <file>
The details of this command are in this link: http://hints.macworld.com/article.php?story=20031017061722471
Jason Lee
- 111
-
2Pointing out that whether or not you can delete a file has to do with the permissions on the directory containing it, not on the file itself. The containing directory is the one being written to. I would not be surprised if a user could remove the immutable flag, then delete the file. – Marc Wilson Aug 31 '21 at 15:25