Ports on Ubuntu — Netstat
List all listening ports
sudo netstat -plnt
Filter by a particular port
$ sudo netstat -plnt | grep ':80'
If something else is listening on the port, you can disable the program by running
sudo service httpd stop
or change its configuration so that it no longer listens on the port. When
netstat
shows the port is free, enable the correct service (for example sudo service vsftpd start
).
If you make any changes because the incorrect service is listening, run the
netstat
command again.
If
netstat
doesn’t show the program listening on the correct port, you need to address its configuration before you go any further.
Check status of firewall
sudo ufw status verbose
To allow/open a port 21
sudo ufw allow 21/tcp
Comments
Post a Comment