Why can't I open ports?

0

Enter image description here As shown in the picture, I set the port in the firewall, but when I look at the port, it shows that only port 22 is open. Enter image description here

질문됨 일 년 전427회 조회
1개 답변
0

The 2 screenshot that you are shared are not relevant to each other. Security group configuration will pass the Client traffic to your EC2 server . Netstat command will return if specific service is running on your operating system.

Port 22 is used to establish an SSH connection, this port is automatically configured during the installation of your operating system, and status will be always Listening.

Looks like you are planning to run some services/applications on ports 80, 8080, 443 etc. You need to first install and then start those services on your operating system on EC2 so that your services start listening on those specified port. (Allowing traffic in Security group is nothing to do with it).

example : I am running Nginx on port 80, then netstat output look like below :

$ netstat -an | grep LISTEN
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN     
tcp6       0      0 :::111                  :::*                    LISTEN     
tcp6       0      0 :::80                   :::*                    LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN   

If I stop Nginx on port 80, then you can see that I am not listening on port 80 anymore.

$ netstat -an | grep LISTEN
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN     
tcp6       0      0 :::111                  :::*                    LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN  
profile pictureAWS
navaz
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠