Junos
Junos

Magic_SysRq_key disable on Junos

‎06-18-2019 02:25 AM

Hello,

Anyone have an idea on how to disable Magic_SysRq_key ?

> start shell user root
# vhclient -s
sysctl -a | grep kernel.sysrq
kernel.sysrq = 0
cat /etc/sysctl.conf | grep sysrq
kernel.sysrq=0

Will this work ? 

6 REPLIES 6
Junos

Re: Magic_SysRq_key disable on Junos

‎06-18-2019 03:46 AM
kernel.sysrq = 0 >>>> Zero mean it is already disabled 
And if you want to disable
sysctl -w kernel.sysrq=0
Junos

Re: Magic_SysRq_key disable on Junos

‎06-18-2019 04:53 AM

On junos 17.2 when i try to enter the command for disabling i god the following message:

 

root@R2:~ # sysctl -w kernel.sysrq=0
sysctl: unknown oid 'kernel.sysrq'

Junos

Re: Magic_SysRq_key disable on Junos

‎06-18-2019 12:41 PM

What type of hardware are you using? I think it should be vmhost based Next Gen Routing-Engine, but want to confirm 

Did you login to the vmhost " vhclient -s" and issue the command? 


Mengzhe Hu
JNCIE x 3 (SP DC ENT)
Junos

Re: Magic_SysRq_key disable on Junos

‎06-18-2019 12:57 PM

Hi! 

 

It seems by default this is disabled by Junos 

 

root@tory-re0-node:~# sysctl -a | grep kernel.sysrq
kernel.sysrq = 0
 
Best
 
Mu

 

Highlighted
Junos

Re: Magic_SysRq_key disable on Junos

‎06-19-2019 12:15 AM

Hello,

 

It is a MX960, not sure about the hardware or if it is using vmhost, i would like to know about possible ways of doing that on Junos prior to 17.4 or later.

 

Thank you!

Junos

Re: Magic_SysRq_key disable on Junos

‎06-19-2019 02:06 AM
Hi,

For a Next Gen RE, the Junos OS runs as a virtual machine over a Linux based host(VMHost). In your case, if it's a Next Gen RE, then the steps to disable Magic_SysRq_key remains the same prior to 17.4 too.

root@MX960> start shell user root
root@MX960:~ # vhclient -s
root@MX960-node:~#
root@MX960-node:~# sysctl -w kernel.sysrq=0
kernel.sysrq = 0
root@MX960-node:~# sysctl -a | grep kernel.sysrq
kernel.sysrq = 0

To enable:

root@MX960-node:~# sysctl -w kernel.sysrq=1
kernel.sysrq = 1

As already explained, kernel.sysrq = 0 indicates that the Magic_SysRq_key is disabled. If kernel.sysrq = 1, then you can disabled it using "sysctl -w kernel.sysrq=0" but make sure you login into the VMhost using "vhclient -s" before you execute the command to disable the Magic_SysRq_key.

You receive the error "sysctl: unknown oid 'kernel.sysrq'" if you execute the command before logging into the VMhost shell.

Hope this helps.

Thanks and Regards,
Pradeep Kumar
Technical Support Engineer | Juniper Networks
*: +1-888-314-5822
*: pradkm@juniper.net




Juniper Internal