skullgiver,
@skullgiver@popplesburger.hilciferous.nl avatar

Always fun to see people with limited understanding of ACLs struggle with filesystems that apply them. Look at this like a chance to learn!

Windows has a lot of features built in to prevent users (and malware) from breaking their system, such as the “system” and “read only” flags. I suppose explorer could’ve asked you to elevate, unset any flags, alter ownership, and delete anyway, but that’s doing a lot of work you don’t necessarily intend to do when you click “delete”.

Linux has this too; try the following:


<span style="color:#323232;">mkdir -p /tmp/test/deleteme;
</span><span style="color:#323232;">touch /tmp/test/deleteme/deleteme.txt;
</span><span style="color:#323232;">chattr +i /tmp/test/deleteme /tmp/test/deleteme/deleteme.txt
</span><span style="color:#323232;"># If you want to apply the "drive from different system" equivalence
</span><span style="color:#323232;">sudo chown -R 12345:12345 /tmp/test/deleteme
</span>

Now try deleting the folder /tmp/test/deleteme from your file explorer:

A screenshot of Gnome’s Nautilus telling the user that they do not have the necessary permissions to remove the folder “deleteme”

Frustrated, you may try to force the issue by forcefully removing the file through the terminal:


<span style="color:#323232;">user@box /tmp/test $ sudo rm -rf deleteme
</span><span style="color:#323232;">Place your finger on the fingerprint reader
</span><span style="color:#323232;">rm: cannot remove 'deleteme/deleteme.txt': Operation not permitted 
</span><span style="color:#323232;">user@box /tmp/test $
</span>

Alright, what if I…


<span style="color:#323232;">user@box /tmp/test $ sudo -i
</span><span style="color:#323232;">Place your finger on the fingerprint reader
</span><span style="color:#323232;">root@box ~ # cd /tmp/test
</span><span style="color:#323232;">root@box /tmp/test # rm -rf deleteme
</span><span style="color:#323232;">rm: cannot remove 'deleteme/deleteme.txt': Operation not permitted
</span><span style="color:#323232;">root@box /tmp/test # whoami
</span><span style="color:#323232;">root
</span><span style="color:#323232;">root@box /tmp/test # 
</span>

No dice! Even root can’t remove these files!

The only way to get rid of these files, is to set/unset the right flags:


<span style="color:#323232;">user@box /tmp/test $ chattr -i deleteme deleteme/deleteme.txt
</span><span style="color:#323232;">user@box /tmp/test $ rm -rf deleteme
</span>
  • All
  • Subscribed
  • Moderated
  • Favorites
  • mildlyinfuriating@lemmy.world
  • DreamBathrooms
  • ngwrru68w68
  • tester
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • mdbf
  • tacticalgear
  • megavids
  • osvaldo12
  • normalnudes
  • cubers
  • cisconetworking
  • everett
  • GTA5RPClips
  • ethstaker
  • Leos
  • provamag3
  • anitta
  • modclub
  • JUstTest
  • lostlight
  • All magazines