How to set up kdump to store crash dumps on a remote server via SSH

May 12, 2025 / Security and Backup Web Hosting

This guide explains how to set up kdump to store crash dumps on a remote server through SSH.

Configuring kdump to save vmcore on a remote server via SSH guarantees crash dumps are securely stored off-site for reliable analysis, even if the local system becomes unusable.

Follow the steps:

  1. Make the RSA Key Pair for Kdump:
    1.  If an RSA key does not already exist, generate one:
      ssh-keygen -t rsa
    2. Then, copy the private key for use with kdump:
      cp /root/.ssh/id_rsa /root/.ssh/kdump_id_rsa
    3. Next, copy the corresponding public key to the remote server (where vmcore will be stored), and verify SSH connectivity:
      ssh-copy-id -i /root/.ssh/id_rsa.pub root@<remote-server>
      ssh -i /root/.ssh/kdump_id_rsa root@<remote-server>
  2. Configure Kdump:
    1.  Edit the /etc/kdump.conf file with the following configuration:
      sshkey /root/.ssh/kdump_id_rsa
      ssh root@<ip_or_hostname_of_remote_server>
      core_collector makedumpfile -F -l --message-level 1 -d 31
      force_rebuild 1

      Note: Comment out or remove any other unrelated parameters.

    2. Also, update the kdump system configuration:
      echo ‘MKDUMPRD_ARGS= “--builtin=libafs”’ >> /etc/sysconfig/kdump
  3. Restart the Kdump Service:
    1. Apply the new settings by restarting kdump:
      # systemctl restart kdump
    2. After a successful restart, you can remove the “force_rebuild 1” line from “/etc/kdump.conf”.
  4. Optional, Test the Configuration:
    1. If you have a test environment, verify the setup by simulating a kernel crash:
      echo c > /proc/sysrq-trigger
    2. To enable verbose kernel messages (useful for debugging), run:
      sysctl kernel.printk=7

After finishing all steps, monitor for future crashes to confirm that the vmcore files are properly captured and transferred to the remote server.

Need to manage backups too? Learn How to Download a Database Dump in Plesk

Spread the love