I can’t change the kernel.sysrq
value.
attempt 1)
I tried:
sudo sysctl -w kernel.sysrq=0
no effect.
attempt 2)
when I edit /etc/sysctl.conf
:
and add: kernel.sysrq=0
and then sudo sysctl -p
and reboot
no effect
attempt 3)
# echo kernel.sysrq=0 > /etc/sysctl.d/99-sysctl.conf
reboot
no effect.
attempt 4)
when I do:
sudo -s
sudo echo "0" > /proc/sys/kernel/sysrq
and then check if it worked:
cat /proc/sys/kernel/sysrq
output is still: 1
sudo nano /etc/sysctl.d/99-sysctl.conf
and add
kernel.sysrq = 0
I already did that, so it already says: kernel.sysrq=0
It works for me and it says so here…
https://wiki.archlinux.org/index.php/Sysctl#Configuration
But why do you want to completely disable it anyway?
Do you use sysrq_always_enabled=1
as kernel parameter?
If so remove that…
Would help to provide the current value of /proc/sys/kernel/sysrq
as reference…
1 Like
attempt 5)
cat /etc/sysctl.d/sysrq.conf
output: kernel.sysrq=0
unfortunately I could not find this variable in sysctl.conf, I wish and it seems that this is enabled somewhere…
current value of /proc/sys/kernel/sysrq
= 1
When I try:
$ sudo echo “0” >/proc/sys/kernel/sysrq
bash: /proc/sys/kernel/sysrq: Permission denied
first do
sudo -i
and then
echo “0” > /proc/sys/kernel/sysrq
Notice the space between > and /proc
What is the output of cat /etc/default/grub
You can find the kernel parameter there if you have it.
It is not a variable, it is a kernel parameter used while providing the kernel to load in your bootloader config.
ex. in your /etc/default/grub
and the like…
chomsky:
cat /etc/default/grub
Sorry guys, the fault was in grub.
sysrq_always_enabled=1
was in grub to load at boot. this was the culprit, I’m sorry.
I forgot about it when I put it there when I followed this tutorial:
Difficulty: ★★☆☆☆
This tutorial was created because people are using a hard power off during freezes, so this will teach you how to turn off your computer when everything is frozen using softer means.
So whenever you see someone saying they had to “Power Off” or “Hard Reset” their system without doing a REISUB, please send them here!
If you’re reading this in response to a question, please click the green link above this text to bring you to the full unabridged text of the tutorial…
1 Like
The reason was; I am trying to harden my setup with lynis and it gave me a warning that the kernel option kernel.sysrq needed to be 0.
system
Closed
1 January 2021 17:23
12
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.