Search⌘ K
AI Features

Security Groups and SSH into the EC2 Instance

Explore how security groups act as firewalls for EC2 instances, controlling inbound and outbound traffic with precise rules. Learn to create key pairs and security groups to enable SSH access, troubleshoot common permission errors, and use EC2 Instance Connect for quick instance management. Gain practical skills essential for AWS SysOps administration and the certification exam.

Security groups

Security groups are an instance-level firewall service and a fundamental unit in AWS network security. They control which traffic is allowed into or out of our EC2 instance. We can secure our EC2 instances by using security groups alone. Security groups have rules to control both inbound and outbound traffic from EC2 instances.

Features of security groups

  • Security groups in AWS are stateful. This means that all return traffic to and from security groups is allowed. For example, our instances can serve HTTP traffic even if we have no outbound rules and only one inbound HTTP rule.
  • We only have allow rules in security groups. All other traffic is denied.
  • Newly created security groups allow no inbound traffic (have no inbound rules) and allow all outbound traffic (have one rule to allow all outbound traffic).
  • Security groups are specific to an AWS Region.
...