Skip to content

Security Groups & Key Pairs πŸ” ​

Welcome back, cloud cadet! 🌀️ Now that your EC2 instance is launched, it’s time to lock the doors and keep your cloud palace safe.

In EC2, this is done using Security Groups and Key Pairs. Don’t worry, it’s easier than remembering your Wi-Fi password πŸ˜….

Security Groups – Your Cloud Firewall πŸ”₯ ​

Think of a Security Group as a magical firewall around your EC2 instance:

  • It decides who can enter and who gets blocked
  • You can allow traffic only from specific IPs or networks
  • Each EC2 instance can have one or more security groups

Common Rules ​

ProtocolPortWho Can AccessFun Analogy
SSH22Your IP onlySecret door for Linux πŸ–±οΈ
RDP3389Your IP onlyWindows VIP entrance πŸͺŸ
HTTP80EveryonePublic lounge 🌐
HTTPS443EveryoneSecure VIP lounge πŸ”

Pro tip: Only open ports you really need. Leaving everything open = inviting hackers to your cloud party πŸ•΅οΈβ€β™‚οΈ

Key Pairs – Your Magic Key πŸ—οΈ ​

A Key Pair is like a private key for your instance:

  • Public key β†’ AWS keeps it on the instance
  • Private key β†’ You keep it safe on your computer (.pem file)

You use this key to log in securely to your instance:

  • Linux β†’ SSH (ssh -i mykey.pem ec2-user@IP)
  • Windows β†’ RDP with a password derived from the key

Important Tips ​

  • Download the .pem file when creating a new key pair
  • Never lose it – losing it = no entry 😱
  • Do not share it – it’s your secret magic key πŸ”’

Quick Security Reminder ​

  • Security groups = who can come in
  • Key pair = how you unlock the door
  • Together, they keep your EC2 instance safe from intruders πŸ›‘οΈ

Built by noobs, for noobs, with love πŸ’»β€οΈ