firewall-cmd doesn't show open ports on CentOS7
by hacback17 from LinuxQuestions.org on (#5B3YJ)
Hi pals
When running Code:sudo firewall-cmd --list-ports, it doesn't show up any ports even though there are several ports open, for example SSH.
Code:[osboxes@osboxes ~]$
[osboxes@osboxes ~]$ sudo firewall-cmd --state
running
[osboxes@osboxes ~]$ sudo firewall-cmd --list-services
cockpit dhcpv6-client ssh
[osboxes@osboxes ~]$ sudo firewall-cmd --list-ports
[osboxes@osboxes ~]$
[osboxes@osboxes ~]$ grep ssh /etc/services | head -n1
ssh 22/tcp # The Secure Shell (SSH) Protocol
[osboxes@osboxes ~]$You can see the screenshot here for a better view: https://ibb.co/9ZMyGcK
So my question and confusion is that if a service, for example SSH is running, why it doesn't show the port when executing this Code:sudo firewall-cmd --list-ports. Is it normal? I am new to firewalls.
Thanks in advance!


When running Code:sudo firewall-cmd --list-ports, it doesn't show up any ports even though there are several ports open, for example SSH.
Code:[osboxes@osboxes ~]$
[osboxes@osboxes ~]$ sudo firewall-cmd --state
running
[osboxes@osboxes ~]$ sudo firewall-cmd --list-services
cockpit dhcpv6-client ssh
[osboxes@osboxes ~]$ sudo firewall-cmd --list-ports
[osboxes@osboxes ~]$
[osboxes@osboxes ~]$ grep ssh /etc/services | head -n1
ssh 22/tcp # The Secure Shell (SSH) Protocol
[osboxes@osboxes ~]$You can see the screenshot here for a better view: https://ibb.co/9ZMyGcK
So my question and confusion is that if a service, for example SSH is running, why it doesn't show the port when executing this Code:sudo firewall-cmd --list-ports. Is it normal? I am new to firewalls.
Thanks in advance!