Let me explain - the reason you restart a computer (unmaliciously) is usually just to reset memory and have a clean boot / program start. So what if you made a program that catches reboot/shutdown sequences (Ctrl + R/S, os.shutdown(), os.reboot(), shell.run("reboot"), shell.run("shutdown") etc.) and just clears memory while starting a clean shell/startup program?
This would make it so the computer never actually restarts/shuts down without the server/game crashing or restarting, making it impossible for someone to bypass your startup program.
Just an idea, not sure if it's possible to reset RAM but you could maybe catch all the variables created in a base layer of your OS? Refer to this:
Potentially already thought of before, but I'll give it a go..
Multi-layer OS.
Granted, the one shown below is only two layers, but basically what happens is the OS has 2 (or more) coroutines running - one which runs background processes like timers (like the clock), more important key pressses (like ones that handle "Home", "Back", "Task Manager" etc.), change variables in the background as needed (even things as simple as changing UI colours). This layer will be the BASE. The next layer up can be the OS layer. This is what you see and what you can do. It handles all on-screen UI interaction and handles all the functions that you would expect from a UI.
You click on "Control Panel" you expect the Control Panel to open, where you can change user details, UI colours, system options etc.
You click on "Create a window" and you can create a second window that has DJShell running in it.
It just works, and works better than the one coroutine trying to handle everything at once. Most real OS' use the same technique, you just don't notice it as an end-user because it's not meant to be noticed - it's just meant to work.
Plus, you can have a more constant feel with the OS, accessing windows, taskbar or a specific key from ANYWHERE in the OS, not just where the OS is listening. Because of the BASE layer, the OS will ALWAYS be listening to certain commands, as long as it is running.
"Home", "Back", "Forward" and "Task Manager" can be described as something like Android's Home, Back and Running Processes buttons. These (being on CC) are bound to specific keys, which can be accessed from anywhere in the OS.
Pretty nifty idea, though I've never seen an OS that utilises this layer system enough.