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-sys45 shutdown-sys45 poweroff-sys45where the name of the e.g.
powerofftool 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-sys45if I want to do it for real on that particular host.