Some Linux software works by listening for incoming connections. A simple example would be a web server, which handles user requests whenever someone navigates to a website. As a Linux administrator or user, it’s important to always know which ports of your system are open to the internet. Otherwise, you could be unaware of outside connections being made to your computer, which consumes bandwidth and resources, along with being a potential security hole.
In this guide, we’ll see how to check for open ports on Ubuntu Linux. This can be done with several different command line utilities, which we’ll go over in detail. We’ll also see how to use Ubuntu’s ufw firewall to make sure ports are secure. So, do you know which ports of your system are open? Let’s find out.
In this tutorial you will learn:
- How to check for open ports with
ss
command - How to check for open ports with Nmap utility
- How to check for and add allowed ports in ufw firewall