{"id":100,"date":"2011-06-06T15:45:44","date_gmt":"2011-06-06T14:45:44","guid":{"rendered":"https:\/\/www.phillips321.co.uk\/?p=100"},"modified":"2011-06-06T16:07:48","modified_gmt":"2011-06-06T15:07:48","slug":"linux-and-the-magic-sysrq-key","status":"publish","type":"post","link":"https:\/\/www.phillips321.co.uk\/2011\/06\/06\/linux-and-the-magic-sysrq-key\/","title":{"rendered":"Linux and the Magic SysRq Key!"},"content":{"rendered":"<p>So your Linux box has locked up and you can&#8217;t get a response&#8230; step in SysRq!<\/p>\n<p>This wonderful key is on most keyboards and i bet you&#8217;ve hit it a low more times than you realise as it&#8217;s usually paired up with the PrtSc (PrintScreen) key. What does it do?<\/p>\n<p>Well it allows you to send system requests to a linux kernel, effectively allowing you to bypass the usual GUI\/CLI layers.<\/p>\n<p>Unfortunately to be able to utilise this magic key it has to be compiled into the kernel with the following option enabled CONFIG_MAGIC_SYSRQ. The good news is that the majority of kernels have this option enabled but from a security point of view maybe this isn&#8217;t a good thing.<\/p>\n<p>Alt + SysRq + [YourChoice] are the magic key presses required. Shown in the below table are the usual steps you should take to try to rescue a Linux system:<\/p>\n<div class=\"codecolorer-container bash vibrant\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/><\/div><\/td><td><div class=\"bash codecolorer\">unRaw - Force any application with keyboard<span class=\"sy0\">\/<\/span>mouse control to give it back to you<br \/>\ntErminate - send SIGTERM to all processes<br \/>\nkIll - send SIGKILL to all processes<br \/>\nSync - send remianing data buffers to disk<br \/>\nUnmount &nbsp;- remount all filesystems read-only<br \/>\nreBoot - finally a reboot<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>And the way i remember this is BUSIER backwards.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So your Linux box has locked up and you can&#8217;t get a response&#8230; step in SysRq! This wonderful key is on most keyboards and i bet you&#8217;ve hit it a low more times than you realise as it&#8217;s usually paired up with the PrtSc (PrintScreen) key. What does it do? Well it allows you to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[60,61,57,59,58],"_links":{"self":[{"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/posts\/100"}],"collection":[{"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/comments?post=100"}],"version-history":[{"count":11,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/posts\/100\/revisions"}],"predecessor-version":[{"id":111,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/posts\/100\/revisions\/111"}],"wp:attachment":[{"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/media?parent=100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/categories?post=100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/tags?post=100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}