관리 메뉴

Sysops Notepad

[Linux] Redhat 8 / Centos 8 SSH 접속 안될 경우(Firewalld 사용법) 본문

업무/sys

[Linux] Redhat 8 / Centos 8 SSH 접속 안될 경우(Firewalld 사용법)

sysops 2019. 5. 20. 17:45

SSH가 안되는 이유는 많지만 최근 발생한 경우의 수 한가지로는

RHEL 8 버전부터는 iptable가 아닌  firewalld의 nftables로 네트워크 필터링을 대처함에 따라

SSH와 같은 서비스포트 제어는 firewall cli를 사용하시어 아래와 같이 사용하시면 됩니다.

 

# systemctl status firewalld


# firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: enp0s3
  sources: 
  services: cockpit dhcpv6-client ssh
  ports: 
  protocols: 
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules: 

[ firewalld 를 미사용할 경우 ]
# systemctl stop firewalld

# systemctl disable firewalld

 

[fierwalld를 사용 할 경우 ]

# firewall-cmd --permanent --zone=public --add-port=22/tcp # firewall-cmd --reload

 

설정확인

# vi /etc/firewalld/zones/public.xml 


How to check the firewall status on Redhat 8.
How to stop firewall on Redhat 8.
How to start firewall on Redhat 8.
How to permanently disable firewall on Redhat 8.
How to enable firewall to start after reboot.

Comments