# Establish a connection to your EC2 instance

* In order for you to establish an SSH connection to your EC2 instance:<br>
  * **On the Security Group, add an Inbound Rule to allow SSH traffic** to your EC2 instance.<br>
  * **On the NACL, add both an Inbound and Outbound Rule to allow SSH traffic** to your EC2 instance.<br>
* **NACLs = Stateless (Less traffic is allowed**; i.e. return traffic must be explicitly allowed).<br>
* **Security Groups = Stateful (Full traffic is allowed**; i.e. inbound AND outbound).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://karansingh.gitbook.io/tutorialsdojo-wrong-answers/test-5-72/establish-a-connection-to-your-ec2-instance.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
