2017-04-07 1 views
0

CentOS 6 시스템에서 작업하고 있습니다. 나는 다음과 같은 가이드를 따라 시도했다 : 내가 대상 시스템에 nmap ipofmachine를 실행하면CentOS에서 열린 포트 문제

내가이 이상한 결과가 있습니다. 내가 sudo iptables -L을 실행할 때 여전히

Host is up (0.0079s latency). 
Not shown: 996 filtered ports 
PORT  STATE SERVICE 
22/tcp open ssh 
80/tcp closed http 
443/tcp closed https 
8080/tcp closed http-proxy 

, 나는 다음과 같은 출력했다 :

Chain INPUT (policy ACCEPT) 
target  prot opt source    destination   
ACCEPT  tcp -- anywhere    anywhere   tcp dpt:webcache 
ACCEPT  tcp -- anywhere    anywhere   tcp dpt:webcache 
ACCEPT  tcp -- anywhere    anywhere   tcp dpt:http 
ACCEPT  all -- anywhere    anywhere   state RELATED,ESTABLISHED 
ACCEPT  icmp -- anywhere    anywhere    
ACCEPT  all -- anywhere    anywhere    
ACCEPT  tcp -- anywhere    anywhere   state NEW tcp dpt:ssh 
ACCEPT  tcp -- anywhere    anywhere   state NEW tcp dpt:http 
ACCEPT  tcp -- anywhere    anywhere   state NEW tcp dpt:https 
ACCEPT  tcp -- anywhere    anywhere   state NEW tcp dpt:webcache 
REJECT  all -- anywhere    anywhere   reject-with icmp-host-prohibited 

Chain FORWARD (policy ACCEPT) 
target  prot opt source    destination   
REJECT  all -- anywhere    anywhere   reject-with icmp-host-prohibited 

Chain OUTPUT (policy ACCEPT) 
target  prot opt source    destination   

나는 뭔가를 놓치고 있습니까? 더 많은 정보가 필요하면 알려주세요 (포트 8080을 열려고합니다). iptables을 사용하고있을 경우,

> sudo firewall-cmd --permanent --zone=public --add-port=8080/tcp 
> sudo firewall-cmd --reload 
  • 당신은 sudo를

답변

0

etc/sysconfig/iptables에 다음 규칙을 추가하십시오.

-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT 

다음 명령을 실행하여 저장하십시오. iptables-restore </etc/sysconfig/iptables

0

으로 권한 상승을 구성해야합니다 특정 포트에 연결하면 CentoOS 방화벽을 구성해야합니다 수 있도록하기 위해