Re:Ask HN: I miss CTRL+ALT+DELETE, what's the Linux equivalent?
by Curiositry on Sunday January 15, 2023 @07:35PM
(#34395300)
Ah, thank you!
I use SysRq to REISUB my machine — but I haven't found the SysRq key on Macbook keyboards; and haven't had the nerve to enable SysRq on friend's computers (which I often end up troubleshooting), since I didn't know much about it, what the security implications are, and whether 1 is an advisable value for kernel.sysrq
Those sysctl options could make a big difference; I've wondered about something like that, but assumed the optimal default was built in. Thank you! I'll try tinkering with those values.
Re:Ask HN: I miss CTRL+ALT+DELETE, what's the Linux equivalent?
by LinuxBender on Sunday January 15, 2023 @07:38PM
(#34395325)
There was a time I found some organizations to be paranoid about enabling it because it was mentioned in either CIS or NIST hardening but it ignores the fact that the same information can be gathered with other tools so I suppose it depends on if you have to follow a standard that still says sysrq is a risk and if your SOC1/SOC2 documentation refers to those standards as part of your audits. But in reality if that were a risk then there are a myriad of other things that would have to be disabled as well and some of those things require recompiling the kernel to disable.
Another thing to research is tuning options like vm.min_free_kbytes, vm.swappiness, vm.lowmem_reserve_ratio, vm.user_reserve_kbytes, vm.admin_reserve_kbytes, vm.overcommit_ratio and vm.overcommit_memory in /etc/sysctl.conf to swap early, and reserve more memory for the kernel based on how much installed RAM you have available. Just setting vm.overcommit_ratio to 0 can solve some hung systems for a number of people at the expense of some applications not launching when memory is low. Another thing to research if you do not have enough RAM is zswap, especially useful to reduce writes to SSD's. To see if your kernel has zswap support:
[1] - https://www.kernel.org/doc/html/v4.15/admin-guide/sysrq.html