I don't think messing with the permissions on
shutdown are the way to handle the situation. Basically you just learned a lesson. Chin up.
I've done the same kinds of things -- getting long chains of ssh sessions, then messing with the routes on one of the machines I was ssh'd through, cutting myself off. I've botched a rsync request, leading to a systematic destruction of a system on the other side of the world. I've run
rm -rf / path on a production server. (That time I got to learn how the restores worked.)
So, much older and hopefully a little bit wiser, I now have strict rules I impose on myself.
- All root prompts end with a #, no matter what other information is in them.
- Any time I am at a # prompt, I literally sit on my hands before pressing the enter key.
- If there's any doubt about what I'm about to do or where I really am or how I got there, I cancel out of it and rebuild it again from a known start condition.
- When I make a mistake (and I still make them, although they are getting both less frequent and more obscure as time goes on), immediately figure out what I've done, who I've impacted, and go confess my sins to them. Then drop everything else and undo the damange as quickly and as best you can.
The nature of my job requires me to spend a lot of time at a lot of varied root prompts, but thanks to my errors in the past I maintain a far better situational awareness than I did when I started.