Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
j0n4s5434357dhttps://man.archlinux.org/man/...
`chattr +i` makes a file immutable -> can't be changed or deleted
This only makes sense on static files though and would need to be set on every file you want to protect.
Though someone with root still can do `chattr -i` (remove immutable flag) on the files and then delete them -
j0n4s5434357d
-
2Fdev2Ftcsh1684357dNetwork mount a folder. It's always annoying when sudo rm doesn't work and I realize that the file is not local.
-
j0n4s5434357dYou could also put the directory elsewhere and bind-mount it read ony
# sudo mount --read-only --bind /your/current/directory /your/new/mount/point
# rm -rf /your/new/mount/point
rm: cannot remove /your/new/mount/point/file1: Read-only file system
rm: cannot remove /your/new/mount/point/file2: Read-only file system
...
Guys,
is it possible to protect a folder against the command sudo rm -rf
Consider the root a drunk person on a high speed road
question