About 25 years ago I saw somebody do a "chmod a-rwx ." as root, at root on an SunOs box. Recovering from that was almost entertaining ;-)
I had to delete some files in a temp folder and typed the command as I was always used to, and pressed enter.
Immediately realised something was wrong and then saw the "*" replaced with a "/". Did not have a fun afternoon.
That was the first, and last time I think, that I used cpio. Phew.
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/chmodThe compiler wouldn't be executable anymore either
$ cp /bin/chmod .
$ chmod -x ./chmod
$ /lib/ld-2.19.so ./chmod
./chmod: missing operand
Try './chmod --help' for more information.That was the first, and last time I think, that I used cpio.