Configuration
The feature is controlled both by a compile-time option in the kernel configuration, CONFIG_MAGIC_SYSRQ, and a sysctl kernel parameter, kernel.sysrq. To be able to use this functionality the CONFIG_MAGIC_SYSRQ
option has to be enabled at kernel compile time.
The SysRq key can be disabled with the following command:
echo 0 > /proc/sys/kernel/sysrqTo re-enable:
echo 1 > /proc/sys/kernel/sysrqOn newer kernels (since 2.6.12), it is possible to have a more fine-grained control. On these machines, the number written to /proc/sys/kernel/sysrq can be zero, one, or a number greater than one which is a bitmask indicating which features to allow.
Possible values are:
- 0 - disable SysRq
- 1 - enable SysRq completely
- >1 - bitmask of enabled SysRq functions:
- 2 - control of console logging level
- 4 - control of keyboard (SAK, unraw)
- 8 - debugging dumps of processes etc.
- 16 - sync command
- 32 - remount read-only
- 64 - signalling of processes (term, kill, oom-kill)
- 128 - reboot/poweroff
- 256 - nicing of all RT tasks
Read more about this topic: Magic Sys Rq Key