I've encountered multiple cases where new Linux users accidentally run a command equivalent to
sudo chown -R $USER:$USER /
which silently destroys permissions for the whole system. (Often this happens because they accidentally mounted the main hard drive in a folder when attempting to mount a USB drive. But sometimes a simple typo.)
Obviously "don't be a noob" is the first answer. But I'm wondering if there's a package that provides a safer chown
, i.e. it warns you if you're about to change ownership of /usr/bin
and refuses to do it unless you do a --force
or something. That seems like a much more sensible default behavior, so if it exists, I'd like to install it on my systems. Does anyone know of something like that?
(I'm not looking for philosophical debates here -- obviously we can't protect against all sudo
actions, but I think an "are you sure" is desirable before nuking a system.)
Asked by Luke
(172 rep)
May 14, 2025, 10:51 PM
Last activity: May 15, 2025, 04:30 AM
Last activity: May 15, 2025, 04:30 AM