[plug] Accidental reboot

Bret Busby bret.busby at gmail.com
Tue May 10 15:38:46 WST 2011


On 10/05/2011, Brad Campbell <brad at fnarfbargle.com> wrote:
> I have a number of machines I routinely use, and a number of virtual
> machines inside those. I've lost count of the number of times I've run
> "sudo reboot" thinking I was logged into a guest and taken down the host
> server.
>
> I've tried all sorts of tricks with /sbin/reboot and /sbin/shutdown to
> try and stop me doing dumb things to no avail.. then this afternoon it
> hit me.
>
> The system's path is :/bin:/sbin:/..so on
>
> Every user (including root when using an interactive shell) has the path
> prepended with /usr/local/bin.
>
> Put together a quick /usr/local/bin/reboot
> #!/bin/bash
> echo Surprise!
>
> Problem solved. Why did it take me so long to think of it?
>

I find it simpler to avoid using sudo.

It is the devil's tool.

-- 
Bret Busby
Armadale
West Australia
..............

"So once you do know what the question actually is,
 you'll know what the answer means."
- Deep Thought,
 Chapter 28 of Book 1 of
 "The Hitchhiker's Guide to the Galaxy:
 A Trilogy In Four Parts",
 written by Douglas Adams,
 published by Pan Books, 1992

....................................................



More information about the plug mailing list