Press the Alt+PrntScrn(SysRq) keys and hold them down while you type each of the following keys in order: R-E-I-S-U-B
R switch the keyboard mode
E send all processes the SIGTERM singal
I sends all processes the SIGKILL signal
S Sync filesystem
U Unmount all devices
B reboots the system (typing O instead will turn the computer Off)
Theoretically you could just do Alt+SysRq+B to do an old school, Win 95 style Ctrl+Alt+Del reboot, but it’s just as bad as hitting that power button. Your best bet is to run the whole sequence to ensure that the system shuts down in the way it would normally shut down when you issue a reboot command.
And it’s almost guaranteed to work even on a completely locked up system. That is, if it’s enabled on your system. If you are not sure, do a really quick test right now:
If you see a 1, you are in good shape.
If you see a 0 (zero), you can enable the SysRq keys by doing:
sudo echo 1 > /proc/sys/kernel/sysrq