3 ms·
No, root can still run chmod, because its superuser privileges override the new restrictive directory perms. That was my point. Maybe the original problem was
by fjarlq 12y ago
No, root can still run chmod, because its superuser privileges override the new restrictive directory perms. That was my point.
Maybe the original problem was actually "chmod a-rwx /bin/chmod" ... That would mean even the superuser couldn't execute /bin/chmod anymore, so you'd have to do something more creative to reset the executable bit on /bin/chmod. Like compile a C program that calls the chmod system call, or:
mv /bin/chmod /bin/chmod.orig
cp -p /bin/ls /bin/chmod
cp /bin/chmod.orig /bin/chmod
- pantalaimon 12y ago> Like compile a C program that calls the chmod system call The compiler wouldn't be executable anymore either
- claviola 12y agoYes, it would. Like he said, you can still run it unless you specifically removed its permissions.