I am really confused about firewall and how to control port access. My initial thought was that it was the firewall (for eg firewalld) which will control the port access to the system. However, it seems that I was wrong. My system is CentOS 7.8
Code: Select all
$ cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)
Code: Select all
[user@master:~]$ ssh 192.168.0.3
user@192.168.0.3's password:
Last login: Wed Jun 15 05:43:32 2022 from master
[user@master3 ~]$
Code: Select all
[root@master3 user]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Tue 2022-06-14 20:33:43 +07; 9h ago
Docs: man:firewalld(1)
Process: 29928 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS)
Main PID: 29928 (code=exited, status=0/SUCCESS)
Code: Select all
# systemctl status iptables
Unit iptables.service could not be found.
Code: Select all
# cat /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
Code: Select all
[user@master:~]$ telnet 192.168.0.3 80
Trying 192.168.0.3...
telnet: connect to address 192.168.0.3: Connection refused
[user@master:~]$ telnet 192.168.0.3 22
Trying 192.168.0.3...
Connected to 192.168.0.3.
Escape character is '^]'.
SSH-2.0-OpenSSH_7.4
Thank you,
D.