Ubuntu common used command

Commonly used commands on Ubuntu Server

Enable firewall

sudo ufw enable

Check firewall status

sudo ufw status verbose

Open ports

sudo ufw allow ssh
# OR (more explicitly)
sudo ufw allow 22/tcp

# Open ports in a range
sudo ufw allow <start_port>:<end_port>/<protocol>

Delete port from firewall

sudo ufw delete allow 22/tcp  # Removes the rule allowing SSH on port 22

Leave a Comment

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.

Scroll to Top