Slackware HowTo

Kernel hardening with sysctl on Slackware

Make some kernel network and protection settings safer with limited and verifiable changes.

1. When to use it

Useful when you want to raise the baseline defense level without moving into invasive customization.

sysctl | kernel hardening | rp_filter | ASLR | protected_hardlinks

2. Base setup

cat > /etc/sysctl.d/99-hardening.conf <<'EOF'
kernel.randomize_va_space = 2
net.ipv4.conf.all.rp_filter = 1
net.ipv4.icmp_echo_ignore_broadcasts = 1
fs.protected_hardlinks = 1
EOF
sysctl --system

Adjust host names, IPs, interfaces, paths, and versions to the real system before making the change persistent.

3. Quick verification

sysctl kernel.randomize_va_space
sysctl net.ipv4.conf.all.rp_filter
sysctl fs.protected_hardlinks

Confirm that the output matches the expected state before considering the intervention complete.

4. Operational notes

Apply a few changes at a time and observe the effects: writing the file is easy, managing regressions is the real work.

Quick checklist

[ ] Steps completed\n[ ] Config updated\n[ ] Tests executed\n[ ] Rollback ready\n[ ] Logs checked

Back to Linux HowTo