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

Hands-on lab for basic ufw usage

You'll need to complete this lab on a clean snapshot of your Ubuntu virtual machine. Let's get started:

  1. Shut down your Ubuntu virtual machine and restore the snapshot to get rid of all of the iptables stuff that you just did. (Or, if you prefer, just start with a fresh virtual machine.)
  2. When you've restarted the virtual machine, verify that the iptables rules are now gone:
sudo iptables -L
  1. View the status of ufw. Open port 22/TCP and then enable ufw. Then, view the results:
sudo ufw statussudo ufw allow 22/tcpsudo ufw enablesudo ufw statussudo iptables -Lsudo ip6tables -L
  1. This time, open port 53 for both TCP and UDP:
sudo ufw allow 53sudo iptables -Lsudo ip6tables -Lsudo ufw status
  1. cd into the /etc/ufw ...
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