I have a number of Linux boxes, and routinely ssh between them. I have, in the past, run
sudo rebootonly to see
Connection to sys45 closed by remote host.and realise that I've told the wrong machine to reboot. To avoid this, I rename
reboot
, shutdown
and poweroff
to e.g.
reboot-sys45 shutdown-sys45 poweroff-sys45where the name of the e.g.
poweroff
tool is unique to that particular host. Then in their place I put the simple one line script e.g.
#!/bin/dash echo "To $0 for real, du $0-sys45."and then if I
sudo reboot
, it will tell me to use sudo reboot-sys45
if I want to do it for real on that particular host.