Link to this headingSysRq

Link to this headingDisable

Check Current SysRq Value:

>>> cat /proc/sys/kernel/sysrq 16

0 - disable sysrq completely
1 - enable all functions of sysrq
2 - enable control of console logging level
4 - enable control of keyboard (SAK, unraw)
8 - enable debugging dumps of processes etc.
16 - enable sync command
32 - enable remount read-only
64 - enable signaling of processes (term, kill, oom-kill)
128 - allow reboot/poweroff
256 - allow nicing of all RT tasks

Temp Enable All SysRq settings:

echo "1" > /proc/sys/kernel/sysrq

Temp Disable All SysRq settings:

echo "0" > /proc/sys/kernel/sysrq

Persistent Enable all SysRq settings:

echo "kernel.sysrq = 1" >> /etc/sysctl.d/99-sysctl.conf

Link to this headingCommands

Set the console log level, which controls the types of kernel messages that are output to the console0 - 9
Immediately reboot the system, without unmounting or syncing filesystemsb
Perform a system crash. A crashdump will be taken if it is configured.c
Display all currently held Locks (CONFIG_LOCKDEP kernel option is required)d
Send the SIGTERM signal to all processes except init (PID 1)e
Call oom_kill, which kills a process to alleviate an OOM conditionf
If the in-kernel debugger kdb is present, enter the debugger.g
Any key which is not bound to a command should also perform this actionh
Send the SIGKILL signal to all processes except initi
Forcibly "Just thaw it" – filesystems frozen by the FIFREEZE ioctl.j
Kill all processes on the current virtual console (can kill X and SVGAlib programs, see below)k
Shows a stack backtrace for all active CPUs.l
Output current memory information to the consolem
Reset the nice level of all high-priority and real-time tasksn
Output the current registers and flags to the consolep
Display all active high-resolution timers and clock sources.q
Switch the keyboard from raw mode, used by programs such as X11 and SVGAlib, to XLATE moder
Output a list of current tasks and their information to the consolet
Remount all mounted filesystems in read-only modeu
Forcefully restores framebuffer console. For ARM processors, cause ETM buffer dump instead.v
Display list of blocked (D state) tasksw
Used by xmon interface on PowerPC platforms. Dump all TLB entries on MIPS.x
Show global CPU registers (SPARC-64 specific)y