Voici comment lister les ports ouverts et les services réseaux en écoute sur son serveur Linux grâce à netstat.netstat -lntup
La sortie sera dans ce style :Connexions Internet actives (seulement serveurs)
Proto Recv-Q Send-Q Adresse locale Adresse distante Etat PID/Program name
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN 30515/redis-server
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 4508/nginx
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 14355/named
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 19448/sshd
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 14355/named
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 26726/exim4
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN 28321/nrpe
tcp6 0 0 ::1:53 :::* LISTEN 14355/named
tcp6 0 0 :::22 :::* LISTEN 19448/sshd
tcp6 0 0 ::1:953 :::* LISTEN 14355/named
tcp6 0 0 ::1:25 :::* LISTEN 26726/exim4
udp 0 0 127.0.0.1:53 0.0.0.0:* 14355/named
udp 0 0 127.0.0.1:921 0.0.0.0:* 14283/lwresd
udp6 0 0 ::1:53 :::* 14355/named
Il est également possible (et plus court) d’obtenir la même information grâce à la commande ss :ss -l