Article 5B3YJ firewall-cmd doesn't show open ports on CentOS7

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!latest?d=yIl2AUoC8zA latest?i=PxqZPGqcijY:Adebo4kpl5A:F7zBnMy latest?i=PxqZPGqcijY:Adebo4kpl5A:V_sGLiP latest?d=qj6IDK7rITs latest?i=PxqZPGqcijY:Adebo4kpl5A:gIN9vFwPxqZPGqcijY
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments