How to disable core dumps in Linux including systemd

www.‮ruttual‬i.com
How to disable core dumps in Linux including systemd

A core dump is a file that contains a snapshot of the memory and other state information of a running process. Core dumps are often used for debugging purposes, but they can also be a security risk because they may contain sensitive data. If you want to disable core dumps in Linux, including on systems that use systemd, you can follow these steps:

  1. Edit the /etc/sysctl.conf file: The /etc/sysctl.conf file is a configuration file that controls various kernel parameters. To disable core dumps, you can add the following line to the file:
kernel.core_pattern = 0

This will disable the creation of core dumps on the system.

  1. Reload the sysctl configuration: After modifying the /etc/sysctl.conf file, you will need to reload the sysctl configuration to apply the changes. You can do this by running the following command:
sysctl -p
  1. Disable the systemd-coredump service: On systems that use systemd, you can also disable the systemd-coredump service to prevent it from creating core dumps. To do this, run the following command:
systemctl disable systemd-coredump
  1. Remove the systemd-coredump package: If you want to completely remove the systemd-coredump package and all associated files, you can use your package manager to uninstall it. For example, on a system using the yum package manager, you can run the following command:
yum remove systemd-coredump

I hope these steps help you disable core dumps on your Linux system! Let me know if you have any questions.

Created Time:2017-10-28 21:39:02  Author:lautturi