0

I have an ec2 instance. It will start a webserver, and my public ip is myip.

I ssh into my machine. What should incoming and outgoing rules? Why? I want only my ip to be able to change things on the server, but anyone to view it in their own browsers. Is this the way to make things "read-only except for myip"?

I have looked at
- What does "incoming" and "outgoing" traffic mean?
- https://help.ubuntu.com/community/UFW

Currently I have

Incoming

  • ssh tcp port 22, only myip
  • http tcp port 80, anywhere
  • https tcp port 443, anywhere

Outbound

  • all traffic, protocols, ports, ip

Finally, is this how to set up a firewall on an ec2 instance? Or should I get ufw? Are they the same idea?

  • Even if you opened every port to the entire internet, your stuff should still be read-only due to passwords/authentication... – ceejayoz Oct 17 '14 at 14:50
0

I ssh into my machine. What should incoming and outgoing rules? Why?

You don't need to bother with any rules on the server itself. There's no need to run a firewall locally, and if you do it will just introduce some confusion.

What you want to do is create a security group for your instance and define any rules there. This is how Amazon defines access to your instance. Within the security group you would define what ports (ssh, http, etc) you want to allow access to, and what IP addresses/ranges you want for each port. So if you want to allow SSH access only from the IP address 1.2.3.4 then you would add a rule to the security group allowing TCP port 22 from 1.2.3.4 and nothing else for port 22.

I want only my ip to be able to change things on the server, but anyone to view it in their own browsers. Is this the way to make things "read-only except for myip"?

Assuming that by "read-only except for myip" and the rules you described above then your security group should allow port 22 from myip only, and ports 80 & 443 from anywhere.

Finally, is this how to set up a firewall on an ec2 instance? Or should I get ufw? Are they the same idea?

Don't bother with ufw or any other client based firewall. You'll just end up needing to modify rules in two places if you do (the security group for the instance and ufw).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.