Skip to Content
Mastering Linux Security and Hardening - Second Edition
book

Mastering Linux Security and Hardening - Second Edition

by Donald A. Tevault
February 2020
Intermediate to advanced
666 pages
15h 45m
English
Packt Publishing
Content preview from Mastering Linux Security and Hardening - Second Edition

Setting kernel parameters with sysctl

The traditional method that you'll see in older Linux textbooks is to echo a value into a /proc parameter. This doesn't directly work with sudo, so you'll need to use the bash -c command to force the command to execute. Here, you can see me changing the value for the icmp_echo_ignore_all parameter:

[donnie@localhost ~]$ sudo bash -c "echo '1' > /proc/sys/net/ipv4/icmp_echo_ignore_all"[donnie@localhost ~]$ cat /proc/sys/net/ipv4/icmp_echo_ignore_all1[donnie@localhost ~]$

With the value set to 1, this machine will now ignore all ping packets, regardless of how the firewall is configured. Any value you set like this is temporary and will go back to its default setting when you reboot the machine.

Next in ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Linux Security and Hardening - Third Edition

Mastering Linux Security and Hardening - Third Edition

Donald A. Tevault
UNIX and Linux System Administration Handbook, 5th Edition

UNIX and Linux System Administration Handbook, 5th Edition

Trent R. Hein, Evi Nemeth, Garth Snyder, Ben Whaley, Dan Mackin

Publisher Resources

ISBN: 9781838981778Supplemental Content