[plug] Accidental reboot

Tim Bowden tim.bowden at mapforge.com.au
Tue May 10 16:01:24 WST 2011

On Tue, 2011-05-10 at 15:21 +0800, Brad Campbell 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?

Rather clever!

I use a different colour gnome term for each remote login so I always
have a visual reference that tells me what machine I'm using.

Tim Bowden

More information about the plug mailing list