Skip to Content
Mastering Linux Security and Hardening
book

Mastering Linux Security and Hardening

by Donald A. Tevault
January 2018
Intermediate to advanced
376 pages
8h 45m
English
Packt Publishing
Content preview from Mastering Linux Security and Hardening

Hands-on lab for basic ufw usage

You'll do this lab on a clean snapshot of your Ubuntu virtual machine:

  1. Shut down your Ubuntu virtual machine and restore the snapshot. (You want to do this to get rid of all of the iptables stuff that you just did.)
  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, enable it, and view the results:
         sudo ufw status         sudo ufw enable         sudo ufw status         sudo iptables -L         sudo ip6tables -L
  1. Open port 22/tcp to allow Secure Shell access:
        sudo ufw allow 22/tcp        sudo iptables -L        sudo ip6tables -L
  1. This time, open port 53 for both TCP and UDP:
        sudo ufw allow 53        sudo iptables -L        sudo ip6tables -L
  1. End of lab.
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

Linux Security and Hardening, The Practical Security Guide

Linux Security and Hardening, The Practical Security Guide

Jason Cannon
Mastering Linux Administration

Mastering Linux Administration

Alexandru Calcatinge, Julian Balog

Publisher Resources

ISBN: 9781788620307Other