0

It was my first time to use aws. I created a new CentOS 7 (x86_64) ec2 instance but it can only connect by ssh in the 22 port.I configed the security group to open an other port and use firewalld to open port on my machine,but it didn't work.Even i configed all ports,it was still the same.I checked all the network configs, VPC,subnet,route table,network acl,security group and try everything i can to do. i am 100% sure that there was no problem with the configs.Then i try setup another instance at anohter area, even setup a lightsail instance, but also cannot open new port(WTF?).Now i don't kown how to do,it really confuse me . By default,when i setup a new instance, is that the only thing i need to do to open a port is config the machine's security group?Do i need to do anything else to open a new port?

3
  • Why do you think the port is not open? May 2, 2019 at 17:29
  • You haven’t indicated what you expect to be listening on an alternate port? 22 works because there is something actually listening on that port. Yes, all it takes is to adjust the security groups applied to the instance, and adjust the firewall on the instance itself, if there is one - kind of redundant when you have security groups. May 3, 2019 at 3:28
  • I use the instance to install a shadowsocks server and i have done this many times before in many other vps like google clound platform and vultr. But after i switched to root user ,run the shadowsocks sevice and open the port i need to listening, i can't access to the shadowsocks server.I ping the port that my server listening throught this site yougetsignal.com/tools/open-ports and the result is that the port is close,no wonder i can't access the server.
    – peter tom
    May 3, 2019 at 8:31

2 Answers 2

0

I konw how to open new port eventually. when setup a new instance,the config "Auto-assign Public IP" should not select "Enable",instead, select "use subnet setting(Enable)".Otherwise the weird thing happend,no matter what you do, you just cannot open any port.Can anybody explain what the config means.By the way, the download speed of ec2 jp area is quit low

-1

You just open a port in ec2 by going to security group and edit it.you can find inbound and outbound connection you can add port in inbound to allow connection and save it.

1
  • 1
    i have done what you say,even allow all ports.
    – peter tom
    May 3, 2019 at 2:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .