check port listeing ubuntu code example Example 1: see what is using a port ubuntu $ sudo lsof -i:22 Example 2: ubuntu open all port sudo ufw allow 1:9999/tcp