I Eat Rainbows

20.12.2006

On the fragility of Linux machines given the root password

Filed under: beryl, linux, root, sudo, suggestion, technology, thoughts, ubuntu — Sohum @ 05.08.00 (255)

So, yesterday, I downloaded the new svn of beryl. Compiles perfectly, but when I run it, it spits out an error.

[some random part] is at version X, while beryl is at version X+1. Sorry, no can do.

Some googling tells me that the simplest solution is to delete everything with ‘beryl’ or ‘emerald’ in the filename, and redownload and recompile.
I get… enthusiastic, and accidentally sudo rm my /usr/bin and my /usr/include.
Now, being the idiot that I am, I haven’t taken a recent backup. The latest one is an Ubuntu 6.06 one (and me running Ubuntu 6.10 now). Some nice folk on ##linux tell me that by far the easiest method is to backup important data and reinstall.
Backing up’s simple from a live cd. Backed up /home, /var, and /etc.
I’ll finish downloading the i386 install cd about 7 hrs from now (I’m downgrading from amd64 (it annoyed me), and we have odd off-peak hours for bandwidth). Till then, I’m stuck using Windows.
Now, my point is, how easy it is, and how easy it should be, to trash a linux system given the root password? It doesn’t complain at sudo rm -fdR /* (I haven’t tried it, but I assume it won’t).
I understand the philosophy behind the root password and everything (oh, if you are root or have sudo access, you’re assumed to be intelligent and careful and all that jazz), but the simple fact is, humans make mistakes. It shouldn’t be that easy to trash your system.
Something as simple as some sort of clarification mechanism on system critical files would go a long way towards alleviating this.
e.g.

bash$ sudo rm -fdR /usr/bin
You are attempting to delete system-critical files (like /usr/bin/sudo). Are you sure you want to continue? (y|n)

One example should be enough. Without an example, the user might figure what he wanted to delete is the system-protected file.
Maybe this functionality already exists. One guy on ##linux mentioned sudo’s ‘bitch mode’. This might be what I’m looking for. If it is, at the least it should be turned on by default.
As a digression, Beryl is très awesome. Very annoying to compile at times, but 0.1.3 should be available for your distribution now.

2 Comments »

  1. ‘Something as simple as some sort of clarification mechanism on system critical files would go a long way towards alleviating this.’

    The closest thing is if you use -i with your rm command; it will ask permission before deleting anything. (i = ‘interactive’ ;)

    Don’t know if you knew.

    Comment by frenchninja — 09.01.2007 @ 13.45.37 (615)

  2. No, I knew about the interactive mode. It’s annoying, ya, but it’s not exactly what I had in mind. I don’t think the user should sit there and tap ‘y’ to every file; I want automated deletion, with exactly one clarification.
    And it should be built into sudo, because sudo is what allows you to trash your system very easily.

    Comment by Sohum — 09.01.2007 @ 18.03.11 (793)

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.