Skip to main content

Firewall

Show listening ports

# Show all listening TCP ports with process names
sudo ss -tlnp

# Show all listening UDP ports with process names
sudo ss -ulnp

# Show both TCP and UDP listening ports
sudo ss -tulnp
#
Show

Enable all connectionsssh (notit justit listening)on sudo22 ss -tunap port)

sudo ufw allow ssh
sudo ufw allow OpenSSH
sudo ufw allow 22/tcp

Enable firewall

sudo ufw enable