Unable to telnet port 2525

0

Hello, I've setup an smtp server on my EC2, t2.micro, ubuntu, which is running on port 2525. I can ssh into the instance and telnet 2525, and my smtp server works perfectly. However, I'm unable to telnet this specific port from outside. I've checked the security group and added a rule to allow all inbound, outbound traffic (all traffic) for port 2525. I've checked the Network Access List and that too is default with no restrictions.

When I try to telnet port 22, that works, but for 2525, I get: telnet: Unable to connect to remote host: Connection refused

질문됨 2년 전602회 조회
2개 답변
1

Connection refused implies server is rejecting the connection. Can you paste the output of the below command? Since you've already checked SG and NACL, check if IPtables is being used perhaps?

netstat -an | grep 2525

profile pictureAWS
전문가
답변함 2년 전
  • $ ps -ef | grep 2525

    ubuntu 1749 1738 0 17:58 pts/1 00:00:00 ./smtp2http -name=lookout -listen=localhost:2525 ubuntu 1759 1637 0 17:58 pts/0 00:00:00 grep --color=auto 2525

    $ netstat -an | grep 2525 tcp 0 0 127.0.0.1:2525 0.0.0.0:* LISTEN

    The smtp server I'm running shows on 2525.

  • This is the problem, in netstat you should see the listener on * or 0.0.0.0 ( * : 2525 Or 0.0.0.0:2525). In your case it is only listening on localhost (127.0.0.1:2525) which is why locally the connection works but not for the remote host. You can compare the same output but for SSH/TCP-22 (netstat -an | grep 22) and you will notice the difference.

0

In netstat output,it shows that it can listen only locally, change the config so that it can listen from either network ip or from 0.0.0.0

sourav
답변함 2년 전

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

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

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

관련 콘텐츠