Search code examples
amazon-web-servicesnetwork-programmingamazon-ec2port

Wanting to allow other services access to different ports but only port 22 is accessible on EC2 instance?


New to networking so having a bit of difficulty understanding how different ports correspond to different functions. I get the gist of port ssh 22, to allow access to your server from anyone who has internet access. This port seems to be the only one I can allow access to on my ec2.

Here are my settings:

enter image description here

When I telnet port 22 it responds successfully. But any other port including 80 do not accept a response.

What Im trying to do is use docker to install a database and expose port 1234. The client requires the host/public IP of the EC2 instance and its port. But if only port 22 is exposed I dont know how I'd be able to be able to interact with crud operations if I cant expose that port.

I am able to ping the server fine, it's only exposing different ports and accessing those where I run into trouble.

Any help is welcomed.


Solution

  • For a port to be accessible from the outside world, some service has to be running on it. For eg., on port 22, ssh service runs by default. so you will be able to telnet into that port. Unless you have installed a web server, the port 80 does not get mapped and hence you cannot connect to that port.

    So for telnet to work, there needs to be a service actively running and listening on the specified port to establish a successful connection from outside.