What is the most destroying command you can type in the Linux terminal?

oriond@lemmy.ml to Asklemmy@lemmy.ml – 155 points –
138

You are viewing a single comment

sudo chmod 000 -R / is very fun way of braking your system and is not widely known πŸ™‚

Can you recover from that?

I imagine if you can mount from a busybox possibly

Then figure out the correct perms.

Yeah that's the painful part. A backup would be key here

Worst case you boot up a virtual server with the same OS as your own and just go down the tree learning permissions, and it’s a deep dive learning experience.

2 more...
2 more...

chroot in and then syncing the permissions from something like the equivalent of filesystem package in Arch for your distro should get you going

2 more...

What does this do? nobody can read any file? would sudo chmod 777 fix it at least to a usable system?

The trick is that you loose access to every file on the system. chmod is also a file. And ls. And sudo. You see where it's going. System will kinda work after this command, but rebooting (which by a coincidence is a common action for "fixing" things) will reveal that system is dead.

Yep. You could run chmod again to fix it (from a different OS / rescue USB), but that would leave all the permissions in a messy state - having everything set to 777 is incredibly insecure, and will also likely break many apps/scripts that expect more restrictive permissions. So the only way to fix this properly would be to reinstall your OS/restore from backups.

How are you gonna run chmod when you don't have permissions to use it anymore?

3 more...